This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Prepare,ModelDriven interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Prepare,ModelDriven interface" Watch "Prepare,ModelDriven interface" New topic

Prepare,ModelDriven interface

MaheshS Kumbhar
Ranch Hand

Joined: Sep 24, 2009
Posts: 188

There is one html form[not shown] asking for person details and is targetted to this myAction class.
The prepare method gets automatically called by framework which will create bare person object after that getModel method will be called by the framwork which will return the object created by prepare method and will put it on value stack.
Now the question is, does the framework automatically uses that person object put by getModel method to set the values from the html form or do we have to write some code to do so
and in this case theres no execute method in myAction class, is it fine?

I am slow but sure
David Newton

Joined: Sep 29, 2008
Posts: 12617

Couldn't you just try it?
I agree. Here's the link:
subject: Prepare,ModelDriven interface
Similar Threads
Struts2 annotation validation
Struts2 Model Driven question for a complex model
Why ModelDriven not working?
Struts2 problem with ModelDriven interceptor
[Struts2] losing display only(prepopulated) values of the form if the validaiton fails