Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Matt Brown
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Damanjit Kaur
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
change the scope of form to session.
 
Matt Brown
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I set scope="session" in both form and action, but still got
the same result.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you are using Struts' html: taglib for textfields.

Also, make sure your input attribute is pointing straight to the jsp.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic