This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts 2 repopulate field when a conversion error happens without using validation.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 repopulate field when a conversion error happens without using validation.xml" Watch "Struts 2 repopulate field when a conversion error happens without using validation.xml" New topic
Author

Struts 2 repopulate field when a conversion error happens without using validation.xml

Aravind Ramanujam
Greenhorn

Joined: Dec 14, 2004
Posts: 16
I'm using struts2. I need to repopulate a date field after a conversion error happens. I'm not using the validator xml for my validation instead using the validate method in my action class. How do i set repopulatefield to true in case of a conversion error?
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

You have to assign it back to the corresponding field. specify value in all the fields.

ex:


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2 repopulate field when a conversion error happens without using validation.xml
 
Similar Threads
Re populating validation.xml fields
Re-populate form after DynaValidatorForm Fails
How to keep original values in jsp when an error message is dispalyed
Can struts repopulate collection from html:select upon submit?
Database constant visibility