This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Understanding public void prepare() +tiles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Understanding public void prepare() +tiles" Watch "Understanding public void prepare() +tiles" New topic
Author

Understanding public void prepare() +tiles

E Robb
Ranch Hand

Joined: Aug 27, 2010
Posts: 111
I have a tiles layout and I want the initial display to use prepare() in the page to populate a field.

If I use prepare() and specify the action then validation is run when the page is initally loaded. Validation errors are returned. If I dont specify result type an error is thrown by Struts.

Bottom line is I want to use one action to set the variables the page may need and the same action execute the page. I dont want multiple actions for every page unless there is a good reason.

Struts.xml:





Validation.xml:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Understanding public void prepare() +tiles
 
Similar Threads
Struts 2.1 javascript field validate
short-circuit attribute not working in validation file
Struts 2 Validation
Action class not being called after validation
error in validation