title: How to use session in JSP pages to get information?
body: <p>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:</p>
  
  <pre><code>&lt;%! String username=session.getAttribute("username"); %&gt;
  &lt;form action="editinfo" method="post"&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;Username: &lt;/td&gt;&lt;td&gt; &lt;input type="text" value="&lt;%=username %&gt;" /&gt; &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>but it gives error saying session cannot be resolved. What can I do about it?</p>