Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@jakarta.apache.org Received: (qmail 8574 invoked by uid 500); 1 Aug 2001 16:25:55 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: struts-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 8567 invoked from network); 1 Aug 2001 16:25:54 -0000 Received: from ns.part.net (HELO mail.part.net) (65.106.108.178) by h31.sny.collab.net with SMTP; 1 Aug 2001 16:25:54 -0000 Received: (qmail 6674 invoked from network); 1 Aug 2001 16:28:34 -0000 Received: from thart-nb.part.net (HELO thartnb) (10.0.1.29) by reckoning.part.net with SMTP; 1 Aug 2001 16:28:34 -0000 Message-ID: <023601c11aa6$82a46630$1d01000a@thartnb> From: "troy hart" To: References: Subject: Re: Templates: a design question Date: Wed, 1 Aug 2001 10:25:00 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2479.0006 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2479.0006 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N 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 SearchResults.jsp... Hope this helps, Troy ----- 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.