My problem is that spring and hibernate configuration successful but validation in spring is not done in custom type(not annonation) by using xml mapping.
I am write validation logic of validate class but how to map that class with dispatcher-servlet.xml file please given me solution on that my reqired is by using multiactioncontroller,xml mapping and spring and hibernate3
Thank you in advance.. My jsp ,java and project struture is follows:
My jsp is :redirect.jsp
Spring xml file:
dispatcher-servlet.xml
My mutiactioncontroller class is:
UserController.java
My validator class is:
UserValidator.java
My bean class is:
Use.java
My Dao interface class:
UserDAO.java
My DAO class:
UserDAOImpl.java
My properties file:messages_en_US.properties name.required = User Name is required
password.required = Password is required
gender.required = Gender is required
country.required = Country is required
aboutYou.required = About You is required
community.required = Select at least one community
Before we get to far down this path why are you using Multi-action controller. The fact that it is deprecated in your code shows that you are using a newer version of Spring which I would have recommended otherwise. I suggest you re-write this using the more modern @Controller paradigm. You will not find much support for these legacy controllers which will likely be removed in one of the next few releases.
Thank you Bill for reply, I am new in spring and i have done create,delete,update and read operation using multiactioncontroller class but my problem is that how to configure validator class in dispatcher-servlet.xml when user not enter any value in jsp page the error msg is display on jsp page . I am done using simpleactioncontroller but problem is that only page validation is done but database operation is not performed.
Please help me on multiactioncontroller validation and xml mapping.
sudarshan jadhav
Ranch Hand
Joined: May 28, 2012
Posts: 41
posted
0
Please help me i have done mapping in dispatcher-servlet.xml and UserValidation class is called when userForm.jsp page fields are blank and user click on submit button in UserActionController class called in that errors are bind successfully but error is through on jsp page is follows:
My UserController class is:
My UserValidator class is:
My new dispatcher-servlet.xml is :
my directory structure as above attachement file and jsp page as above
please help to solve the error about binding to userForm when user click on submit button and all field are blank show on that page error message
Once again since you are new to Spring forget about the multi action controller and learn to do it the modern way with a new version of Spring not using deprecated classes. If you do this an have a question we can help. I would start with working of a newer tutorial. Try this one:
Thank you Bill once again for reply,
I have done validation using modern way i.e @controller thank you for give me link for references .This link is use to solve the validation problem in spring3