aspose file tools*
The moose likes Struts and the fly likes Struts Tiles Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Tiles Question" Watch "Struts Tiles Question" New topic
Author

Struts Tiles Question

Nikes Shah
Ranch Hand

Joined: Jul 18, 2007
Posts: 133
Hi

I am using Struts Tiles in my project.
Project has Header,Menu(Left Navigation containing hyperlinks),and body.

I want display particular JSP page when user clicks on navigation hyperlinks. means only Body should be changed .

Please give information regarding this problem.

Also whether we have to use ForwardAction or separate Action classes for each hyperlinks ?

Thanks
Dom Lassy
Ranch Hand

Joined: May 05, 2006
Posts: 181
You can use frames, iframes, or even ajax to load only the body part of the page.

If you don't need to do any business logic to load a page when a hyperlink is clicked you can just use a ForwardAction. Otherwise, you should use an ordinary action class.
Chris Boldon
Ranch Hand

Joined: Aug 10, 2006
Posts: 190
Each tile is its own JSP.

1.) Each link can be its own action, forwarding to its own JSP.

2.) Each link can be a link to a dispatch action with a unique argument to display particular content on a JSP that is forwarded to.

Personally I usually do the second. I create a dynamic content link, which I pass a variable. I then have the action query the database to inject specific content into a JSP, or pull a whole JSP and push it back through the response. That way I can edit the content without redeployment.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts Tiles Question