Any action that implements the ModelDriven interface must provide a getModel() method that returns an object that represents the action model. Any parameters transferred to the action are considered sub-properties of the model. You can only have one model per action in a ModelDriven action.
For example, suppose we have a model called Profile and an action to edit our profile. In our view, we have a text box for our site. Without using ModelDriven , your action would have getWebsite and setWebsite . Using ModelDriven , the receiver and setter on the model will be called instead. Effectively, getModel().setWebsite("http://stackoverflow.com") .
Example
public class EditProfileAction extends ActionSupport implements ModelDriven<Profile> { private Profile profile;
Steven benitez
source share