I have a JSP page used for editing some user\'s info. When a user logins to the website, I keep the information in the session, then in my edit page I try the following:
Use
<% String username = (String)request.getSession().getAttribute(...); %>
Note that your use of <%! ... %> is translated to class-level, but request is only available in the service() method of the translated servlet.
<%! ... %>
service()
See how JSP code is translated to a servlet.