This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Struts and the fly likes nested tiles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "nested tiles " Watch "nested tiles " New topic
Author

nested tiles

azhar bharat
Ranch Hand

Joined: Jul 17, 2006
Posts: 87
Hi
I plan to use tiles in my aplication instead of jsp pages. But since i havnt used it before, i have a few questions.
Now there are few pages with similar functionalities. It is basically a few forms for posting, but the fields are different for each category. So, there are forms for each category. But all the other things in the page, the headers the graphics etc are same. Is there a way i can replace the jsp page which contains the form according to the parameters in the url?
I hope my question is clear.
Pranav Sharma
Ranch Hand

Joined: Oct 27, 2003
Posts: 256
Azhar you could setup a layout file with header, left menu, footer etc and then a body.

so you will have to replace only the body part of the layout.

You should get a number of good articles if you googled for tiles for more details.
azhar bharat
Ranch Hand

Joined: Jul 17, 2006
Posts: 87
Let me explain it better.

I have a part of my application where the users can post articles. Now, some of the categories of articles require special forms for extra information. For others a common form is displayed.
current pages:
category 1:
mapping to category1Form.jsp
category 2:
mapping to category2Form.jsp
other categories:
mapping to commonForm.jsp

Now, I want to apply tiles to my web app.
But now I am in doubt to which is the best approach.
1) Should I have a separate page for each of these forms?
2) Should I add a an attribute to request or session scope and use the result in tiles:put?
3) is there a better way to do it?
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
check this out, it should solve your problem

tiles def:


pno.jsp:


and from contentHeader.jspf



took me a while to figure out how it works, tiles is not so well-documented. if you find any better way, let me know...

hope it helps,
jan
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
sorry mate, i started with this question of yours:


Is there a way i can replace the jsp page which contains the form according to the parameters in the url?


and provided a way where the tiles-definition controls a nested jsp. not evaluating the url. so, not exactly your question, but maybe a idea for your way to your solution.

and sorry for the stupid smiley. replace with ": P"

cheers,
jan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: nested tiles
 
Similar Threads
Struts: Tiles (for Struts 1.x) and their forms
General Tiles Questions
tiles with java script
Passing values across pages for that session/user
dynamic page(forms) using tiles