struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Leland <rlel...@apache.org>
Subject Re: Input form field values...
Date Thu, 25 Sep 2003 17:39:17 GMT
Take a look at the nightly struts validator example.

The pattern is:
   <!-- JavaScript Type Action -->
      <action    path="/editJsType"
                 type="org.apache.struts.webapp.validator.EditTypeAction"
                 scope="request"
                 validate="false">
         <forward name="success"              path="/jsType.jsp"/>
      </action>

    <action    path="/saveJsType"
               type="org.apache.struts.webapp.validator.TypeAction"
               name="jsTypeForm"
               scope="request"
               validate="true"
               input="/editJsType.do?typeForm.reset=false">
       <forward name="success"              path="/index.jsp"/>
    </action>

The key is always going through the editXXXX action which loads the 
combo boxes etc...
When an error happens since the input is
        /editJsType.do?typeForm.reset=false
This action is called with a parameter telling the form to ignore an 
attempt to reset it's
current values.
Also notice how every thing is stored in the request, otherwise putting 
items in the session ,
any real application with 100's or 1000's of users you'll needlessly use 
up all of your memory resources,
not to mention run slow.

Again get a nightly build and look at the example.

-Rob

Joseph William wrote:

>This is with regards to my question about retaining the form field values when the error
messages shouw up thru the Action errors... Just now, I figured out it was coz of the <html:form/>
In this tag, I had added the name and type attribute too -- This is coz I wanna do the client
side javascripting too for which I need the form name... 
> 
>When I remove the name and type attribute(which is mandatory if we specify the name!)
from the form tag, I am able to retain the form element values in the error messages page!!!
Why is this so??? How to solve this???
> 
>Can anybody out there explain???
> 
>-Joseph
> 
>Hi,
> 
>Im trying to develop a small application using struts. Everything works 
>fine except the Action Errors part -- When the error messages show up, 
>the form element values from the previous screen are not being 
>retrieved in the next screen -- Am I missing something??? Help appreciated...
> 
>Thanks.
>-Joseph
>
>
>
>---------------------------------
>Do you Yahoo!?
>The New Yahoo! Shopping - with improved product search
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message