Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Understanding public void prepare() +tiles

 
E Robb
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!