File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts ServerSide Validate 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 "Struts ServerSide Validate" Watch "Struts ServerSide Validate" New topic
Author

Struts ServerSide Validate

deng shuangyi
Greenhorn

Joined: Aug 15, 2005
Posts: 6
I used *.jsp?id=1000 to save some information about id.And *.jsp has a form.I used Struts ServerSide Validator.But after validate failure redirect to "input"(*.jsp).But the information about id lose.
When I use request socpe and hidden text in the jsp file.The id information aslo lose.But i don't want to use session.What should I do?Thank you!!!
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'd suggest creating property named "id" on your form bean and including the tag: <html:hidden property="id" /> in your jsp.

Then create a forward action mapping (<action name="myForm" path="xyz" forward="/xyz.jsp"></action>) and call xyz.do?id=1000 instead of xyz.jsp?id=1000. This way, Struts will populate myForm with the id property before displaying the jsp, and when the jsp is submitted, the id property will be submitted along with it.
[ January 11, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts ServerSide Validate
 
Similar Threads
iFrame and struts
Displaytag - How to access table id after sorting
extracting the url from a jsp:forward
how to validate HTML element in Struts
Which framework to use in web layer?