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 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 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 "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:
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Understanding public void prepare() +tiles