Considerations for SPRINGMVC Configuration Validator

Source: Internet
Author: User

1 <  Validator= "Validator"/>

When using SPRINGMVC integrated hibernate-validator to do form data validation (page labels use spring's form-related tags), do not know whether due to version reasons or other reasons, you need to put the above configuration on the front , Data validation Comments (for example, @size, @email, and so on) will take effect and the error binding class will receive the error message.

Also, say the difference between Spring-servlet.xml and Applicationcontext.xml in SPRINGMVC:

1:spring-servlet.xml is to read and load the configuration in Dispatcherservlet startup, Applicationcontext.xml is loaded by Contextloaderlistener when the server is started;

2: When the Dispatcherservlet does not use SPRINGMVC to do the control layer (such as with Struts2), Applicationcontext.xml can be used to configure all spring-related things alone; When used together there are some specifications, spring-servlet.xml it is best to load the beans that contain the Web components, such as controllers, view resolvers, and processor mappings, and contextloaderlistener to load other beans in the app, which are typically the middle tier and data-tier components that drive the backend of the application.

Considerations for SPRINGMVC Configuration Validator

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.