Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Servlets and the fly likes tiles definition Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "tiles definition" Watch "tiles definition" New topic
Author

tiles definition

Chris Wang
Ranch Hand

Joined: Jan 13, 2004
Posts: 34
Hi,
I have a problem when I use definition.xml in tiles.
For example, the xml file is like this:
<definition name="mainLayout" path="/layout/classiclayout.jsp">
<put name="title" value="Some title" />
<put name="header" value="/common/header.jsp" />
<put name="menu" value="main.menu" />
<put name="body" value="/common/body.jsp" />
<put name="footer" value="/common/footer.jsp" />
</definition>
I want to add some parameters after body.jsp, just like normal jsp's parameter. So I change one of the above line like this:
<put name="body" value="/common/body.jsp?name=chris&age=30" />
But in definition.xml, The char(&) is not acceptable.
How can I put multi parameters for a jsp in definition.xml?
Any suggestion is welcome.
brad balmer
Ranch Hand

Joined: Mar 08, 2004
Posts: 57
From what I remember, the value can specify the page only.
Why would you want to hard code parameters in the definition? You may have your reasons, but I would think that it would be better to set either a request attribute or a session attribute in the first page and then call the correct getters in the second jsp (or in the intermediate action to pull any DB info).
 
Consider Paul's rocket mass heater.
 
subject: tiles definition