"Spring3.0 is so simple"--Study Note 2

Source: Internet
Author: User

7th Chapter SPRINGMVC

1, controller, if you want to add the method into the model, only need to use the @modeattribute in front of the corresponding entry parameters

2. Spring MVC creates an implicit model object as a storage container for model data before invoking the method. If the incoming parameter of the processing method is a map or model type (Org.springframework.ui.Model, similar to map, is easier to use than map), SPRINGMVC will pass the application of the implied model to these arguments. This allows the developer to access all the data in the model, as well as add new attribute data to the model.

3, SPRING3.0 has its own independent calibration framework, while supporting the JSR303 standard calibration framework, but it does not provide JSR303 implementation, can contain HibernateValidatorJSR303 implementation jar for SPIRNG use. As follows:

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.3.1.Final</version>
</dependency>

Loacalvalidateorfactorybean implements the validator interface of Spirng, and also realizes the validator interface of JSR303. Just define a localvalidatorfactorybean in the spring container. At the same time, the label <mvc:annotation-driven/> provided by spring will be assembled good one localvalidatorfactorybean by default, without us having to declare the bean separately.

"Spring3.0 is so simple"--Study Note 2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.