Cool. It works great now. Thanks Hubert! -----Original Message----- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 9:47 AM To: Struts Users Mailing List Subject: RE: Struts Form Beans Question
Messages sent as recently as a few hours ago say you'd run into problems using the name attribute in your form tag. You'd want to go the intended path, which is: <html:form action="/executeSearchResults"> ... <html:text property="someField"/> ... </html:form> --- Daniel Kalcevich <[EMAIL PROTECTED]> wrote: > It works, but only if I use the name attribute on my <html:text> tag. I > set it to name="searchForm". Although my first part of my form tag is > <html:form name="searchForm". Shouldn't it work without having to > specify the name in the text tag? > > Thanks. > > Daniel > > > -----Original Message----- > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 05, 2004 9:12 AM > To: Struts Users Mailing List > Subject: RE: Struts Form Beans Question > > When validation fails during the call to /executeSearchResults, Struts > will > show the resource specified in the input attribute (".search") using the > form > that failed validation. You don't need to put it in request scope, > Struts > will already know what to do with it. Try it. > > --- Daniel Kalcevich <[EMAIL PROTECTED]> wrote: > > But is that for Request Scope forms as well? Can I say something like > > request.setAttribute( myFormName, this) in the validate() method and > > have the page recognize the form bean and populate the fields? > > > > There are basically two actions: > > > > <action > > path="/executeSearchResults" > > type=" ExecuteLenderSearchAction" > > scope="request" > > name="searchForm" > > validate="true" > > parameter="search" > > input=".search"/> > > > > <action > > path="/search" > > type="org.apache.struts.actions.ForwardAction" > > parameter=".search"/> > > > > When the /search Page is submitted, the searchForm validate() is > called. > > When it fails, I need to put the searchForm back into the request so > > that it can return to the /search page. But if that happened, would > the > > values be populated because there is the searchForm object in the > > request? > > > > -----Original Message----- > > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, May 05, 2004 8:53 AM > > To: Struts Users Mailing List > > Subject: Re: Struts Form Beans Question > > > > Yes. > > As long as your mappings are correct (and they would be if you're > > already > > seeing the behavior you described), Struts will preserve the values in > > case > > of a validation error and allow the user to correct the mistakes. > > > > --- Daniel Kalcevich <[EMAIL PROTECTED]> wrote: > > > Is there a way that I can use "request" scope on an action mapping > and > > > have the submitted form bean be returned in the case of errors? > What > > I > > > have is a search form that when its submitted, calls the Validator > and > > > the Form Beans validate() method. Can I like set the form bean back > > > into the request or something so that if an validation error occurs, > > > when I forward the user back to the search page to correct it, the > > > values remain intact. > > > > > > I know this works with the Session scope, but its not something that > > > really belongs in the session. The search for my needs is more of a > > > request by request basis. > > > > > > Thanks in advance. > > > > > > Daniel > > > > > > > > > > > > > __________________________________ > > Do you Yahoo!? > > Win a $20,000 Career Makeover at Yahoo! HotJobs > > http://hotjobs.sweepstakes.yahoo.com/careermakeover > > > > --------------------------------------------------------------------- > > 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] > > > > > > > > __________________________________ > Do you Yahoo!? > Win a $20,000 Career Makeover at Yahoo! HotJobs > http://hotjobs.sweepstakes.yahoo.com/careermakeover > > --------------------------------------------------------------------- > 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] > __________________________________ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover --------------------------------------------------------------------- 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]