I am supposed to work on struts on as project and it is like learning a crash course and work the next day. In Struts 1.1 enviroment, I am using DynaValidatorForm to create a bean form and then perform validation. 1. I write a DynaValidatorForm definition in struts-config.xml 2. I write xml for action so that when /getQuotes.do in invoked by a jsp form, the form data is put into the QuoteDetailsBean. 3. add the plugin script for ValidatorPlugIn
xml fragment from struts-config:
Now I write a validation code for getQuotes.do. note that I can write the validation code with <form name="QuoteDetailsBean"> but this form bean is shared by many jsp, so i am using the name of the action (getQuotes) as the name of the form in the validation.xml. So far this looks okay, as I am going by some example.
xml fragment from validation.xml:
Does this looks okay. I wrote so far based on some tutorials n help online. Now when I open the JSP and then do a submit, there is no validation (I tried by submitting with empty forename and surname. I mean i could invoke the action class and the invoke class redirects(forwards) to the appropriate path. so the code works fine except validation is not done
Q1. So what should i do more to get client-side validation? What actually happens in client-side validation? does a pop up alert appears? nothing happens so far in my case.
Q2. What should I do more for server side validation. Since the form is incomplete, what happens? I thought the same form returns and the error messages are printed in the jsp page since i have the <html:errors /> tag just below the <body> tag.
The action class is pretty simple so far:
Please help me out. I think I am missing something which i need to do