<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=613105013-01032006>For what it's worth, problem solved - I was making a
dumb mistake. You can set request <EM>attributes</EM> (as opposed to
parameters) to any kind of Object you like, and retrieve them in subsequently
executed page elements. I'd tried to retrieve mine before the
<cms:include> invocation, but now that I've put things in the right order
it all works fine.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=613105013-01032006></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=613105013-01032006>Jon</SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> opencms-dev-bounces@opencms.org
[mailto:opencms-dev-bounces@opencms.org] <B>On Behalf Of </B>Jonathan
Woods<BR><B>Sent:</B> 28 February 2006 20:09<BR><B>To:</B> 'The OpenCms mailing
list'<BR><B>Subject:</B> [opencms-dev] Sharing state across included
JSPs<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><SPAN class=417040020-28022006><FONT face=Arial size=2>I have a JSP
template which uses <cms:include> to include a couple of other JSP page
elements (header and footer, predictably enough). I create an object or
two in the header which I need to use in the page body and in the footer, but at
the moment I'm struggling to see how I can share the object
reference:</FONT></SPAN></DIV>
<DIV><SPAN class=417040020-28022006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=417040020-28022006><FONT face=Arial size=2>1. Putting it
into the page context, either via Java (pageContext.setAttribute()) or via
<jsp:useBean>, doesn't seem to work - I guess this is because the
'include' is dynamic and we're dealing with different Java
scopes.</FONT></SPAN></DIV>
<DIV><SPAN class=417040020-28022006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=417040020-28022006><FONT face=Arial size=2>2. Same with the
request context, again because the include is dynamic. OpenCms
documentation suggests that you can set request parameters before executing the
include, but from the taglib only String setting is possible - and I want
to share a reference to something other than a String.</FONT></SPAN></DIV>
<DIV><SPAN class=417040020-28022006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=417040020-28022006><FONT face=Arial size=2>3. Putting it
into session context is (i) a pity, because otherwise I don't need to set up
sessions and maintain session state, and (ii) not really appropriate, because in
theory the same client could make two requests so quickly that two JSP-serving
threads would hit the same session state. I realise there are ways round
(ii), but I'd rather not go there if there's an easier
solution.</FONT></SPAN></DIV>
<DIV><SPAN class=417040020-28022006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=417040020-28022006><FONT face=Arial size=2>Any ideas
welcomed. I would really love to get on with some coding and stop having
to wrestle with the execution environment like this!</FONT></SPAN></DIV>
<DIV><SPAN class=417040020-28022006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=417040020-28022006><FONT face=Arial
size=2>Jon</FONT></SPAN></DIV>
<DIV><SPAN class=417040020-28022006><FONT face=Arial
size=2></FONT></SPAN> </DIV></BODY></HTML>