Passing Parameters to Tiles Layout

2005-01-12 Thread Tait, Allen
Assume a standard Tiles layout with Header, Navigation, Body, and Footer,
each implemented as a JSP.   In this setup, the navigation.jsp is
responsible for dynamically generating the left hand navigation from an XML
configuration file.  For each page request, this component needs to build
the navigation appropriate for that page.  The body.jsp contains a parameter
needed by the navigation to determine the correct navigation.  
 
What are some approaches for passing values like this from the body.jsp to
the navigation.jsp?   The goal is to allow web programmers to add body.jsp
(or new pages) to a web site by creating and adding the page only.  The page
would contain the body's HTML and this navigation parameter.  Assuming the
appropriate navigation is already defined in the configuration file, no
other configuration would be needed to add a page (i.e. struts*.xml,
tiles*.xml)
 
Thanks
Allen


RE: Passing Parameters to Tiles Layout

2005-01-12 Thread David G. Friedman
Allen,

You could make your action a Struts Tiles Action subclass and set a tile
parameter's value manually based upon the id... For example, you could set
the tile's body component to the value form.getBody() IF your page was
submitted with body=somepage.jsp or something like that.  If you do that,
I would recommend you test that the file exists before setting the tile's
body component.  If you need concreted examples, check the archives under
my name as I posted something like that in the last 90 days.

Regards,
David

-Original Message-
From: Tait, Allen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 12, 2005 8:47 AM
To: 'user@struts.apache.org'
Subject: Passing Parameters to Tiles Layout


Assume a standard Tiles layout with Header, Navigation, Body, and Footer,
each implemented as a JSP.   In this setup, the navigation.jsp is
responsible for dynamically generating the left hand navigation from an XML
configuration file.  For each page request, this component needs to build
the navigation appropriate for that page.  The body.jsp contains a parameter
needed by the navigation to determine the correct navigation.

What are some approaches for passing values like this from the body.jsp to
the navigation.jsp?   The goal is to allow web programmers to add body.jsp
(or new pages) to a web site by creating and adding the page only.  The page
would contain the body's HTML and this navigation parameter.  Assuming the
appropriate navigation is already defined in the configuration file, no
other configuration would be needed to add a page (i.e. struts*.xml,
tiles*.xml)

Thanks
Allen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]