struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ned Seagoon" <therealneddyseag...@hotmail.com>
Subject jsp rendering to session property for caching?
Date Fri, 02 Feb 2001 10:59:40 GMT

Hi all, wonder if you can help with ideas of how I can achieve this:

I need to include two portions of html on every page - a tree structure 
which references layers that are included at another section of the page.

Both of these sections will contain a lot of iteration and bean accesses and 
this does not change too often, so I would prefer to cache this information 
on the session. (of course the best thing to do is use frames, but we cannot 
do this for various reasons)

What I would like to do is from the controller, process some view JSPs (that 
can access session beans) and store the returned html in the session object 
*before* forwarding onto pages which would write out these values onto the 
rendered page. something along these lines:

RecreateTreeAction.perform(...)
{
  // update the internal model

  request.getSession().setAttribute( "tree", RenderJsp("tree.jsp") );
  request.getSession().setAttribute( "layers", RenderJsp("layers.jsp") );

  return mapping.findForward("homepage");
}

and in say, homepage.jsp:

<bean:write name="tree">
.. whole bunch of other stuff ..
<bean:write name="layers">

Any ideas people?

Cheers
Ned
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


Mime
View raw message