Request acceptance parameters of Struts action
1. Struts2 provides three data encapsulation methods
Action itself acts as a model object and is encapsulated by a member setter
Create an independent model object. The page is encapsulated by ognl expressions.
Use the ModelDriven interface to encapsulate the request data
Action can be a Model or Controler.
2. The Action itself acts as a model object and is encapsulated by a member setter. It is a required property setter method and has no relationship with getter (property-driven method ):
3. Create an independent model object. The page is encapsulated by an ognl expression. The set and get methods (property-driven) of the User must be required) <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> Vc3ryb25np1_vcd4kpha + PHN0cm9uZz48aW1nIHNyYz0 = "http://www.2cto.com/uploadfile/Collfiles/20140817/20140817093455100.png" alt = "\">
4. (1) will there be a thread problem when Action encapsulates data?
Action is multi-instance. Each request creates an Action object without thread security issues.
Servlet. Struts1, which is a singleton. Thread problems exist.
The performance of Struts2 is relatively damaged.
(2). In the first data encapsulation method, data is encapsulated into the Action attribute, and it is impossible
The Action object is passed to the business layer.
(3) who will encapsulate the parameters?
Parameter encapsulation completed by the Interceptor:
. Implement the ModelDriven interface to encapsulate the request data (model-driven)