Hi Stir Rini,
As u know the code u put in scriplets (i. e. <% %>

goes in the _jspService method of the servlet generated. Now in ur code, u have declared the variable user in a try catch block hence it would not be visible outside of that block. Just declare the user variable out side along with the variables 'ResultSet' and 'Statement', the error will vanish.
Hope this will help u understand.