File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts: Tiles (for Struts 1.x) and their forms Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts: Tiles (for Struts 1.x) and their forms" Watch "Struts: Tiles (for Struts 1.x) and their forms" New topic
Author

Struts: Tiles (for Struts 1.x) and their forms

Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2053
Hi,

I deleted this topic not knowing somebody replied to it. I am posting it again now hoping to get that reply again.

I have a common sublayout on the right side of all pages. It is, as is done in Tiles, in its separate (jsp) file.

I have dynamic data in that sublayout, i.e., sort of an advertisement which changes every page refresh (e.g. tips on how to use the application, which changes every page refresh). Lets say, this data is called Tip.

My question is on the form. I am new to Tiles.

Since all pages use this sublayout, Tip must be in all form classes, is that correct?

And if that is so, it will be great to make a superclass form, with Tip as one of its fields, is that correct? And all forms will extend this superclass?
Siddharth Naik
Ranch Hand

Joined: Apr 09, 2006
Posts: 35
Sounds like your problem is related to the following thread:

http://www.coderanch.com/t/58954/Struts/TILES-include-action-as-body

In the above-mentioned thread, action is used as body in a tiles definition. This way tiles will always call an action first to render JSP. You can define the variable and get required value in action to arrive at desired JSP dynamically.


Thanks<br />Sid
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2053
Originally posted by Siddharth Naik:
Sounds like your problem is related to the following thread:

http://www.coderanch.com/t/58954/Struts/TILES-include-action-as-body

In the above-mentioned thread, action is used as body in a tiles definition. This way tiles will always call an action first to render JSP. You can define the variable and get required value in action to arrive at desired JSP dynamically.


Thanks.

My question is not the same.

But I have solved it already somehow.

I tried it myself. And yes, all the sub-layouts, share the form object, so the data must be put in that form; and on superclass, ideally, if shared by all pages.
 
wood burning stoves
 
subject: Struts: Tiles (for Struts 1.x) and their forms