This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Action Form does not remember values

 
Rashmi Tambe
Ranch Hand
Posts: 418
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 6547
21
Java Linux Mac Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic