In cases when you are dealing with several properties, the book protects the use of an object to store these properties, instead of having a direct action to make your work easier. Consider the following examples:
public class CreateNewWidgetAction extends ActionSupport {
private String property1;
private String property2;
private Long property3;
...
public String execute() throws Exception {
Widget widget = new Widget();
}
}
public class CreateNewWidgetAction extends ActionSupport {
private Widget widget;
public String execute() throws Exception {
}
}
Widget (, 1, 2 3).
, , , .
:
ModelDriven, property1, property2, property3 .. , , .
ModelDriven, widget.property1, widget.property2, widget.property3 .. , , .
, . :
JavaBeans , ModelDriven Java . , .
- Struts 2 , 3. Struts 2 > - . 62