struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "troy hart" <>
Subject Re: Templates: a design question
Date Wed, 01 Aug 2001 16:25:00 GMT
The approach I use (and I believe it is a common approach) is to have two
jsp pages for each page on my site that is going to use templates. For
example, if I have an ecommerce site it is likely I will have a shopping
cart page, a search page and a search results pages... For this example, the
set of jsp pages would be as follows:

MainLayout.jsp - the main template layout page.
ShopCart_content.jsp - the actual content of the shopping card page.
ShopCart.jsp - the shopping cart page that references MainLayout.jsp and
tells it to use ShopCart_content.jsp...
Search_content.jsp - the actual content of the search page.
Search.jsp - the search page that references MainLayout.jsp and tells it to
use Search_content.jsp...
SearchResults_content.jsp - the actual content of the search results page.
SearchResults.jsp - the search results page that references MainLayout.jsp
and tells it to use SearchResults_content.jsp...

This way your action mappings reference ShopCart.jsp, Search.jsp, and

Hope this helps,


----- Original Message -----
From: "Oleg Bondarenko" <>
To: <>
Sent: Wednesday, August 01, 2001 10:57 AM
Subject: Templates: a design question

Hello all,

I am very new to Struts and I find it interesting. I like the action mapping
and also templates, but I have difficulties using them together.

E.g. I have a central page, say Main.jsp that has a template which contains
constant header and footer and a variable content part. This content part (a
jsp) must be determined at the run-time. Because of the template I have to
always send back to the user the Main.jsp. How to use action mapping then?

One possible solution would be the following. The action handler stores the
variable content part as a session attribute and always returns the global
mapping "main" (which is mapped to the Main.jsp). The Main.jsp retrieves the
central variable part from the session and pass it to the template.

This works, but I have a feeling that I am not correctly using the Struts.
Any input from experts would be highly appreciated.

Best Regards,
Oleg Bondarenko


Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorised copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

View raw message