title: Session attribute not reflected in JSP
body: <p>So I have jsp one that loads some request params as a session which I access in my second jsp . </p>
  
  <p>My jsp 1 code is : </p>
  
  <pre><code>&lt;jsp:useBean id="Emails" scope="request" class="java.lang.String" /&gt;
  &lt;%
  
  String email = Emails;
  session.setAttribute( "allEmail",email);
  %&gt;
  
  &lt;p style="display:block" &gt;&lt;%= session.getAttribute( "allEmail" )%&gt;&lt;/p&gt;
  </code></pre>
  
  <p>My jsp 2 code is : </p>
  
  <pre><code>&lt;p style="display:block" &gt;&lt;%= session.getAttribute( "allEmail" )%&gt;&lt;/p&gt;
  </code></pre>
  
  <p>Now I can see the <code>&lt;p&gt;</code> in the first jsp populated properly with the data but the paragraph in my second jsp just blank </p>
  
  <p>when I change    <code>session.setAttribute( "allEmail",email);</code>  to something like    <code>session.setAttribute( "allEmail","hello world);</code>   I can see the correct value reflected in both paragraphs . </p>
  
  <p>What am I doing wrong ? </p>
  
  <p>the servlet that populates jsp1 has the following request dispatcher</p>
  
  <pre><code>RequestDispatcher dispatch = request.getRequestDispatcher("jsp1");
  </code></pre>
  
  <p>I think the issue is both the jsp's are initialised at the same time so the session in the second jsp has no value . </p>