aspose file tools*
The moose likes Struts and the fly likes Form forgets data after validate method returns errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Form forgets data after validate method returns errors" Watch "Form forgets data after validate method returns errors" New topic
Author

Form forgets data after validate method returns errors

Eric Juneau
Greenhorn

Joined: Jul 13, 2009
Posts: 28
Is there a way to retain the non-writable data in a form without a bunch of hidden fields?

Say I have a form that contains various fields, some are read-only, some are writable. If the validate method in the form executes and returns an error, all the data on the form, except for the writable fields disappears. Is there a way to retain this data without having a html:hidden field for each read-only field?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29261
    
140

Eric,
Welcome to JavaRanch!

You do need the hidden fields to submit the data to the server. You can then store it in the session to avoid keeping it from being sent back and forth extra times though.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Form forgets data after validate method returns errors
 
Similar Threads
How to retain textfield value while reseting
validate() method & validation.xml
difference between and validate() and validation.xml
Re populating validation.xml fields
clearing HTML form fields after return from struts validation with errors