22.Spring MVC form bean validation using resource bundle | Form Validation

preview_player
Показать описание
In this video i am going to show you how perform Spring MVC form bean validation using resource bundle.
When we accept user inputs in any web application, it become necessary to validate them. We can validate the user input at client side using JavaScript but it’s also
necessary to validate them at server side to make sure we are processing valid data incase user has javascript disabled.
Below is the GitHub link to download source code:
Рекомендации по теме
Комментарии
Автор

Hi sir can you please share the namespace you have added in the spring config file because I added all those jars but the spring form: from tags I am unable to use and getting error more over after adding hibernate dependencies you added an tags for annotation in the configuration file but that annotation is not available in my spring configuration file so it's very clear that I have been missing the namespace in the spring configuration file

If you share me that it more helpful

byjuv.s
Автор

hi, is there is way to validate the data type is valid or not for filed value. if i give the long value which exceeds the max value its giving an Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Long' for property error. how to customize it.

banupriya
Автор

Is it possible to do this validation without using @ModelAttribute way of fetching data? For example, by creating model object inside the function and then assigning the fetched values, as done on some of the earlier videos. How to perform Hibernate validation in that case?

abhijeetsharma
Автор

The tutorial is really awesome!
In the earlier videos, you said naming bean with an id is not mandatory.
But when i execute the project without naming the bean with id (for class="org.springframework.context.support.ReloadableResourceBundleMessageSource"), it doesn't render the error message from messages.properties(though it dont throw any errors).
Only when i name a bean with id as "messageSource", it renders error message from messages.properties.

Which way is correct?

venkateswarank