title: Passing a session attribute from from controller to jsp spring
body: <p>snippet of code defined in the controller of my application</p>
  
  <pre><code>@RequestMapping(value = "/get-data", method = RequestMethod.GET)
      public List&lt;Chat&gt; getAllChats(HttpServletRequest request,
              HttpServletResponse response) {
          String email = (String) request.getSession().getAttribute("email");
                ....
  </code></pre>
  
  <p>I am able to retrieve the email attribute and pass it into a string variable. My challenge is passing the variable from the session to a jsp file. Snippet of code of the jsp </p>
  
  <pre><code> for (var i = 0; i &lt; json.length; i++) {
  
                          theUser = email; //retrieve the email of the session here
                          theClass = json[i].user.email == theUser ? "bubbledRight" : "bubbledLeft";
  </code></pre>
  
  <p>How can I use the retrieved session attribute to a jsp file.</p>