Even my code is working with 2 action mappings, but I have 15 JSP pages so I will have to have 30 action mappings which is worrying me.
>>> [EMAIL PROTECTED] 06/19/03 01:04PM >>> thanks for the feedback. -----Original Message----- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Thursday, June 19, 2003 12:57 PM To: Struts Users Mailing List Subject: Re: How to ignore validation when form loads (first time) I found that the approach with 2 action mappings worked fine and I got the impression when I first chose this method that it is intended to be use this way. I also used your method to check whether to validate, in situations where I had a list of records where some could be edited and some could be deleted. When deleting, I wanted to inhibit validation. Adam Kandi Potter wrote: > Hi Sashi, > > Don't know if you've received any replies to this, but I initially handled it the same as you, but ran into problems when I was going back to the servlet for drop-down actions etc. I only wanted validation errors to appear when the user hit the save button, so I ended up just checking for the save in the validation method as such: > > //only validate form when a save has been pressed > try {if (request.getParameter("saveBtn.x").equals(null)) return null;} > catch (NullPointerException ex) {return null;} > > I'm also interested in feed-back on my approach. > > > -----Original Message----- > From: Sashi Ravipati [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 18, 2003 1:19 PM > To: [EMAIL PROTECTED] > Subject: How to ignore validation when form loads (first time) > > > Hi > > We have JSP pages which need user input. How can I display the form initially with out validation and then when user enters data and submits the page, the validation has to be done. > > I tried to accomplish it by giving two <action> in Struts-Config.xml. as shown below > > eg: > <action path="/AddRate" type="xxxx.AddRateAction" name="addRateForm" input="AddRate.jsp" scope="request" validate="false" > > <forward name="success" path="AddRate.jsp"/> > </action> > <action path="/Rate" type="xxxx.AddRateAction" name="addRateForm" input="AddRate.jsp" scope="request" validate="true" > > <forward name="success" path="AddRate.do?target=create"/> > </action> > > Not sure if this the way to do. Can somebody tell me if there is a better way to accomplish this. > > Thanks > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]