• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

nested tiles

 
azhar bharat
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic