jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes How to keep original values in jsp when an error message is dispalyed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to keep original values in jsp when an error message is dispalyed" Watch "How to keep original values in jsp when an error message is dispalyed" New topic
Author

How to keep original values in jsp when an error message is dispalyed

Matt Brown
Ranch Hand

Joined: Jan 26, 2004
Posts: 69
I'm using <html:errors> to display error messages on the top of a jsp.
When an error happens, the same jsp will be dispalyed with the error message
on the top, but all the field are cleared. I want to keep the original values in the fields.
How should I do it? Thanks


"I just use my muscles as a conversation piece, like someone walking a cheetah down 42nd Street." - Arnold Schwarzenegger
Damanjit Kaur
Ranch Hand

Joined: Oct 18, 2004
Posts: 346
change the scope of form to session.
Matt Brown
Ranch Hand

Joined: Jan 26, 2004
Posts: 69
I set scope="session" in both form and action, but still got
the same result.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Make sure you are using Struts' html: taglib for textfields.

Also, make sure your input attribute is pointing straight to the jsp.


A good workman is known by his tools.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to keep original values in jsp when an error message is dispalyed
 
Similar Threads
error in websphere
Url Masking
JSF - How can I get hyperlink in error messages?
Url masking
get the hyperlink text to another jsp page?