简体   繁体   中英

Spring-MVC: Calling a Validator, not from within a Controller

I would like to call a Validator on some object, but not from within a Controller, and then get the Error object.

Could you provide a code sample for this?

Spring's docs show how to use Validator without a Controller in sight:

http://static.springsource.org/spring/docs/2.0.x/reference/validation.html

Been possible since the beginning. It's commonly used in Controllers and the web tier, but that's not required. There's no dependency on the web tier in the validator framework.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM