You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Neil Aggarwal <ne...@JAMMConsulting.com> on 2005/07/08 18:57:33 UTC
How to set tiles attribute dynamically?
Hello:
I have a site I am developing that has some pages with direct content
and some where the content comes from a database.
For the direct pages, I have a layout that depends on a pageTitle
attribute in the tiles definition. Here is an example:
<definition name="locations.index" extends="layout.back">
<put name="pageTitle" value="Locations" />
<put name="content" value="/locations/index.jsp" />
</definition>
The layout.back embeds the pageTitle into the page using
<tiles:getAsString name="pageTitle" />
For the database driven pages, I am trying to use a generic
definition:
<!-- Tiles definition of database page -->
<definition name="page.dbPage" extends="layout.back">
<put name="content" value="/showPage.jsp" />
</definition>
With this struts action:
<action path="/showPage" forward="page.dbPage"/>
When I code the links to the db pages, I put a page parameter
on the action:
<html:link action="/showPage?page=community" ...
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?
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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: How to set tiles attribute dynamically?
Posted by mosho <ro...@gmail.com>.
Neil,
I am trying to do same thing my page_title comes from the db and it depends
on the parameter.
I fail to understand, how are you doing it? Do you have some example code.
You are creating another class as MyController?
Thanks
--
View this message in context: http://www.nabble.com/How-to-set-tiles-attribute-dynamically--tf132145.html#a5637812
Sent from the Struts - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org