File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Action Form does not remember values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Action Form does not remember values" Watch "Action Form does not remember values" New topic
Author

Action Form does not remember values

Rashmi Tambe
Ranch Hand

Joined: Aug 07, 2001
Posts: 418
Hi all,
I have an action form and mapping defined as follows-

<action path="/edit"
name="contactInfo"
input ="/editContact.jsp"
scope="session"
validate = "true"
type="com.mytest.editAction">
<forward
...

the action form 'ContactForm' has a validate mathod that validates the field values present in editContact.jsp. Whenever some validation fails, the control comes back to editContact.jsp. however, all the field value are cleared on the page. so i have to fill the entire page once again and submit it. Can't these values be retained? why r they cleared every time action erros are thrown?
How can u make the action form remember the values???
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4458
    
    6

I just ran into the same problem this week. The fix that worked for me was removing the name and type attributes from the html:form tag in the JSP. For some reason that I haven't quite figured out yet, specifying these attributes (which I normally don't but found that apparently some folks do) in the form tag makes the Struts tags render input fields with value="" instead of the value currently in the form object.


Junilu - [How to Ask Questions] [How to Answer Questions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Action Form does not remember values