Parameter bindings for wrapper types
Requirements: Commodity search conditions. In the method of commodity query, the article realizes the incoming of the commodity query condition.
Implementation method
The first method: Add the HttpServletRequest request parameter to the formal parameter. Accept query condition parameters through request.
Second method: Let the Pojo of the wrapper type accept the query condition parameter in the formal parameter
Analysis: Features of page-pass parameters:
Complexity, diversity, conditions include: User account, product number, order information ....
If you place user accounts, product numbers, order information, etc. in simple Pojo (attributes are simple types)
In Pojo class properties are more, more chaotic. It is recommended to use the wrapper class Pojo. Packaging class Pojo class in the genus
Sex is the user, goods, orders, such as simple pojo.
Page pass and controller method parameter definitions
Note: The Itemscustom is consistent with the properties in the wrapper Pojo.
The package type can also be used to modify the product information, if the product modification parameters use HttpServletRequest request type of formal parameters, not conducive to the extension of the function. For example, if the product modification interface has both a product name and a customer name, and the product name and customer Name attribute names are the same, if you use the request type parameter, you cannot distinguish between the name of the product or the name of the customer. The packing Pojo should be used.
Learning qq:2460425648