Springmvc parameter binding and springmvc binding
Bind the parameter in Annotation development: Convert the key/value string from the request to the form parameter by converting the key/value string, and pass the converted result to the form parameter. Springmvc supports parameter binding:1. Default supported types: HttpServletRequest, HttpServletResponse, HttpSession, Model/ModelMap 2. Simple data type, integer, string, and dateAs long as the parameter name and Parameter Name of the request are consistent, automatic binding is successful. If the parameter name and Parameter Name of the request are inconsistent, you can use @ RequestParam (specify the parameter name of the request ), add to the front of the Parameter3. pojo typeAs long as the request parameter name is consistent with the attribute name in pojo, the request parameter is automatically set to the attribute in pojo. Note: The parameters have both the pojo type and simple type. Parameter binding does not affect custom parameter binding: date type binding custom 4. Bind The packaging type pojo ParameterAnalysis: Page parameters are complex and diverse. The conditions include user account, product number, and order information... If you place all these attributes in a simple pojo (the attribute is a simple type), there are many and messy pojo class attributes. We recommend that you use the packaging type pojo. The attribute in pojo is pojo. Controller: directly using pojo to receive ItemsQueryVO is a packaged pojojsp.5. Set Type parameter binding 1. Simple type set parameter bindingControllerjsp, a collection parameter that uses arrays as form parameters to receive requests2. pojo type set parameter bindingYou can use both arrays and lists. list is usually used. (When you need to submit data in batches, bind the submitted data to list <pojo>.) Note: This pojo type set parameter is bound, you must use a list or array as an attribute in a packaging class, and then use this packaging class object as a form parameter to receive request parameters. Wrap the pojo class ItemsQueryVo and put the object that needs to be loaded with the itemsCustom set into the packaging class. Controllerjsp