Just use 2 separate actions - one for the submit and one for the page load. The submit action will user validate and the load one won't.
Regards, Dimitar -----Original Message----- From: regatta DeBlanc [mailto:[EMAIL PROTECTED]] Sent: Friday, April 05, 2002 2:37 PM To: Struts Users Mailing List Subject: RE: Struts html:link tag Thanks for the input, but that's not what I want. I want to have form validation, but only when the user clicks on the Submit button and not when the page is loaded. And I want to load the page through struts (<html:link page="/user/userAdd.do">). How can I have Struts to differentiate between an action triggered by a page being loaded and an action triggered by a request being submitted after the Submit button was clicked??? --- Tim Sawyer <[EMAIL PROTECTED]> wrote: > You can turn off validation on a form bean for a > particular ActionMapping by > specifying validate="false" in the action mapping. > > See > http://jakarta.apache.org/struts/doc-1.0.2/api/index.html > for more > details. > > <action path="/addUser" > type="strutstest1.SystemUserAction" > name="userForm" > scope="request" > input="/admin/dsp_User.jsp" > validate="false"> > <forward name="success" > path="/admin/dsp_User.jsp"/> > <forward name="failure" > path="/admin/search/dsp_SearchUser.jsp"/> > </action> > > Tim. > > > -----Original Message----- > > From: regatta DeBlanc > [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, April 04, 2002 4:03 PM > > To: [EMAIL PROTECTED] > > Subject: Struts html:link tag > > > > > > How can I use the html:link tag to reference a > page, > > without trigerring the validation process. > > > > e.g. > > > > <html:link page="/user/userAdd.do"> > > > > This will trigger the validate() operation in the > > userAddForm and the perform() operation in > > userAddAction, BEFORE displaying the page > userAdd.jsp. > > > > The problem here is that I have added a check in > the > > validate() operation so that it adds an > ActionError if > > the user did not fill in the username text box. > But > > this check is meant for when the user hits the > submit > > button, not when the page is first loaded. > > > > When referencing the page with: > > <html:link page="/user/userAdd.do"> > > how can I differentiate, in the ActionForm and > Action > > operations, between the case when the page is > first > > loaded and the case when the user hits the submit > > button?? > > > > I know I can solve the problem by referencing the > page > > as follows: > > <html:link page="/jsp/user/userAdd.jsp"> > > but I want to try to do it the "Struts" way so > that I > > can load the page with templates that are derived > in > > the Action. > > > > > > > > __________________________________________________ > > Do You Yahoo!? > > Yahoo! Tax Center - online filing with TurboTax > > http://taxes.yahoo.com/ > > > > -- > > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>