aspose file tools*
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
Author

Validating the form in struts1.3

vijay.hubino ramasamy
Greenhorn

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: 296

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 field.you 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.

Regards
Jatan

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Validating the form in struts1.3