Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic