title: Pass page scope attributes to a JSP using pagecontext.include for use in JSTL?
body: <p>We're using this JSP template solution almost verbatim at work:</p>
  
  <p><a href="http://java.sun.com/developer/technicalArticles/javaserverpages/jsp_templates/" rel="noreferrer">http://java.sun.com/developer/technicalArticles/javaserverpages/jsp_templates/</a></p>
  
  <p>When it gets JSP pages to be included, it uses pageContext.include, which leaves us with one problem, and that is that we have a lot of scriplet code that gets initialized in the JSP itself (tag soup). My thought was to modify the template tag with an additional attribute that is a package path reference to a class with an init or execute method. That execute would get called first, and would add page context attributes before including the JSP. We would then use JSTL to access those attributes. However, I was told this wouldn't work because of how pageContext.include works, and the inability to pass through attributes scoped to the page. Is that true, and are there workarounds? I'm so-so on knowing all my scoping rules.</p>