spring 3 validation example
12,203
This is a good link to start with Spring 3 validation Spring 3 MVC: Show validation message with custom validator.
for reading properties file use:
ValidationUtils.rejectIfEmpty(errors, "userId", "field.required");
in Validation class. and using
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value = "messages" />
</bean>
in dispatcher-servlet.xml file to load message.properties file.
And it is working fine..
Cheers
Shams
Related videos on Youtube
Author by
Shams
Updated on June 04, 2022Comments
-
Shams almost 2 years
Can anybody give me a link for Spring 3.0 Validation, by extendingorg.springframework.validation.Validator
orjavax.validation
Interface and reading error messages from properties file?Thanks
Shams