title: how to access the request attribute, on an included JSP
body: <p>So I am currently creating a header that will be included on all my JSP for this dynamic web application. This header needs a important variable from the request attribute. I am sending the request to the main page.</p>
  <pre><code>    request.getRequestDispatcher(&quot;/homepage.jsp&quot;).forward(request, response);
  </code></pre>
  <p>homepage.jsp currently has an include of this header.jsp.</p>
  <pre><code>&lt;jsp:include page=&quot;/header.jsp&quot; /&gt;
  </code></pre>
  <p>I know it is getting the header asset, as I'm arriving on the page but getting a null pointer trying to reach the request attribute out of the request.</p>
  <pre><code>MembershipBean membership = new MembershipBean();
      membership = (MembershipBean)request.getAttribute(&quot;membership&quot;);
      
  </code></pre>
  <p>How do I access the request attribute of the main page I am sending this too?</p>