Dave:

That worked perfectly!  Thanks for the hint.

Thanks,
        Neil

--
Neil Aggarwal, JAMM Consulting, (214) 986-3533, www.JAMMConsulting.com
FREE! Valuable info on how your business can reduce operating costs by
17% or more in 6 months or less! http://newsletter.JAMMConsulting.com

> -----Original Message-----
> From: Durham David R Jr Ctr 805 CSPTS/SCE 
> [mailto:[EMAIL PROTECTED] 
> Sent: Friday, July 08, 2005 1:35 PM
> To: Struts Users Mailing List
> Subject: RE: How to set tiles attribute dynamically?
> 
> 
> > The problem is that the pageTitle depends on the parameter
> > value and is not fixed.  Is there a way to put a method 
> > call in the tiles-defs.xml so I can pull the correct page 
> > title from the database?
> 
> IMO, the best way to do this is at the Tiles Controller level.
> Controllers receive a ComponentContext object which allows you to put
> attributes into the tiles scope.  Since it also receives the request
> object, you basically end up with something like this:
> 
> 
> public class MyController extends ControllerSupport {
> 
>       public void execute(
>                       ComponentContext tileContext,
>                       HttpServletRequest request,
>                       HttpServletResponse response,
>                       ServletContext servletContext)
>                       throws Exception {
> 
>               tileContext.putAttribute("pageTitle", 
>                               request.getParameter("pageTitle");
> 
>       }               
> 
> 
> }
> 
> 
> I'm leaving out the details that go in the tiles-defs file, 
> because I'm
> guessing that you already know them.  If not, let me know and maybe I
> can provide you with more help.
> 
> 
> - Dave
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


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

Reply via email to