File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Validating the form in struts1.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validating the form in struts1.3" Watch "Validating the form in struts1.3" New topic

Validating the form in struts1.3

vijay.hubino ramasamy

Joined: Sep 24, 2012
Posts: 1
In my application i am using struts 1.3 framework.I am validating the form through xml.I have used the same form in many pages since my inputs are nearly same in all the pages.In one page i need to validate only 4 fields(say) and in another page i need to validate 8 fields.I have validated all the fields in validation.xml.
I am submitting a form with 4 fields to be validated but in xml i have validated 8 fields.So ActionErrors are not empty and the same page loads again.What i need to to validate only the 4 fields and load a new page that is specified.Any way to achieve this? I have googled out but i could not make it.Any help is appreciated.
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 297

Hi Vijay,

the one approach is to separate the common fields put it in parent form which child can access. Give the default values to parent form field which are not necessary for the valdiation and keep the validation on the child need to extend the parent form . I dont know whether it will be fit for your design or not.

Second is common define fields in valiation.xml for each form.


I agree. Here's the link:
subject: Validating the form in struts1.3
jQuery in Action, 3rd edition