struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian K. Buckley" <bbuck...@surfglobal.net>
Subject struts and Geary's templates
Date Tue, 28 Aug 2001 13:18:44 GMT
Hi,

I'm using struts along with the template tags from David Geary's Advanced
JavaServer Pages book.

As described in the book, I have defined all my pages in a single definition
file (for example, regionDefinitions.jsp shown below), and in order to use
the pages, I have created 2-line jsp files for each id in the definition
file, each of which calls region:render for the id (example below).

Is there a way in struts to avoid creating all these little helper jsp
files?  It would be cleaner to be able to just name ids in the actions and
forwards of the struts-config.xml file rather than having to name jsp files.

Besides being bothersome, changes to the basic template file do not "take"
automatically - it is necessary to "touch" each helper jsp file before
Tomcat knows to recompile pages.

Any suggestions or comments?

- Brian

--------------
regionDefinitions.jsp------------------------------------------------------

<region:define id='myfirstpage' scope='request' template='xxx.jsp'>
   <region:put .../>
   <region:put .../>
</region:define>

<region:define id='my2ndpage' ...>
  ...
</region:define>

<region:define id='my3rdpage' ...>
  ...
</region:define>

etc...
----------------------------------------------------------------------------
--------------

--------------
myfirstPage.jsp------------------------------------------------------
<% @ include file="regionDefinitions.jsp %>
<% region:render region='myfirstpage'/>
----------------------------------------------------------------------------
--------------

--------------
mysecondPage.jsp------------------------------------------------------
<% @ include file="regionDefinitions.jsp %>
<% region:render region='my2ndpage'/>
----------------------------------------------------------------------------
--------------

--------------
my3rdPage.jsp------------------------------------------------------
<% @ include file="regionDefinitions.jsp %>
<% region:render region='my3rdpage'/>
----------------------------------------------------------------------------
--------------

etc...
--------------------------------------------------------------------




Mime
View raw message