This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Struts and the fly likes [Struts2] losing display only(prepopulated) values of the form if the validaiton fails Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "[Struts2] losing display only(prepopulated) values of the form if the validaiton fails" Watch "[Struts2] losing display only(prepopulated) values of the form if the validaiton fails" New topic
Author

[Struts2] losing display only(prepopulated) values of the form if the validaiton fails

sv kvr
Greenhorn

Joined: Jan 25, 2007
Posts: 2
Hi,
I have a jsp which displays some read only information and few fields for input which are all part of the same bean/form.
When the form is submitted and the validation fails, the display only information is lost from the form. below is my code. how do i retain my form values and still display the validation errors?



Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

1) Post your authorizedUser.jsp code completely.

2) Suggestion here you are using chain result type which is not required(if possible avoid using chain). Instead you can prepare interceptor for populating data.


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.
sri kota
Greenhorn

Joined: Mar 21, 2008
Posts: 3
If I use prepareinterceptor, would it be called automatically, everytime, my submit is called? along with validation xml? Can you help me with an example to implement prepare in this scenario. Below is the jsp.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Struts2] losing display only(prepopulated) values of the form if the validaiton fails
 
Similar Threads
<s:select> and fail validation
Retrieving request parameters (from the url) in a jsp page
appfuse validation problem
Struts 2 checkboxlist error - list key could not be resolved
Interceptor messes up action class in Struts2