• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Action Form does not remember values

 
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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???
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic