My session gets lost in the mix.  I am supporting a legacy legacy system and I don't have the luxury of porting to tiles.  During the process of file1.jsp (which performs a template include using file1content.jsp to provide the body of the page) I have printed the indentity hash code of my HTTP session.  And I get two different values!  Two session.  That doesn't make sense to me.  I'm using a template to control the page structure but I want the same context throughout the page rendering.  What am I missing?  I have:
 
file1.jsp that contains:
 
<%@ page import="javax.servlet.jsp.tagext.TagSupport" %>
<%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %>
 
<% System.out.println(" hashcode: " + System.identityHashCode( session ) ); %>
<template:insert template='sometemplate.jsp'>
  <template:put name='title' content='a title' direct='true'/>
  <template:put name='header' content='header.jsp />
  <template:put name='content' content='file1content.jsp />  
  <template:put name='footer' content='footer.jsp' />
</template:insert>
<% System.out.println(" hashcode: " + System.identityHashCode( session ) ); %>
 
 
AND sometemplate.jsp contains:
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML4.01 Transitional//EN">
<%@ page import="javax.servlet.jsp.tagext.TagSupport" %>
<%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %>
<% System.out.println(" hashcode: " + System.identityHashCode( session ) ); %>
 
<html>
  <head>
    <title><template:get name='title' flush='true'/></title>
  </head>
      
  <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <table cellspacing="0" cellpadding="0" border="0">  
      <tr>
        <td colspan="3">
          <template:get name='header' flush='true'/>
        </td>
      </tr>
      <tr>
        <td colspan="3">
          <template:get name='content' flush='true'/>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <template:get name='footer' flush='true'/>
        </td>
      </tr>
    </table>
  </body>
</html>
 
**************************
 
When the page is requested I get the following session hashcodes printed out:
 
hashcode: 1111111
hashcode: 2222222
hashcode: 1111111
 
Huh?  Why does the processing of the commands in sometemplate.jsp occur IN A DIFFERENT SESSION ??  Is there configuration option?  Is this expected behavior? 
 
David
 
_______________________________________________
Juglist mailing list
[email protected]
http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to