title: Access servlet declared HttpSession in jsp
body: <p>If the username, password and location are correct in login servlet i am creating a HttpSession and get to the jsp page. Below is the code in servlet:</p>
  
  <pre><code>    HttpSession sessionsa = request.getSession(true);
      sessionsa.setAttribute("user",userName); //userName is a String variable
      sessionsa.setAttribute("location",location); //location in value place is a String variable
  </code></pre>
  
  <p>Now on jsp page I am not able to access the attributes. Code on jsp:</p>
  
  <pre><code>    sessionsa = request.getSession();
      String user = (String) sessionsa.getAttribute("user");
      String location = (String) sessionsa.getAttribute("location");
  </code></pre>
  
  <p>It states that cannot find symbol variable sessionsa in class SimplifiedJSPServlet. Please help. Have been googling it since 2 days.</p>