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 Getting teh same JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Getting teh same JSP" Watch "Getting teh same JSP" New topic
Author

Getting teh same JSP

manasa teja
Ranch Hand

Joined: May 27, 2002
Posts: 325
I have simple struts JSP and am using struts validation framework for validating the user input...
ON ce, we enter emplooyee name in the JSP, it will validate the user input
for required, special chars, spaces, .. I am displaying the error messages as pop-ups..
Now my doubt is , after the validation is fine, i shold get the same page, with some data displayed in the same page..
how can I achieve this..
thanks
Raman
[ October 07, 2003: Message edited by: M K Raman ]

MT
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15229

If the validation is successful you should then be finding out what the forward is in your <action/> elements in the struts-config.xml file. So you might have something like
<action....
..>
<forward name="valid" path="/page.jsp" />
</action>
In this example, page.jsp is the same page, so when you come back to this page, you should have some data, a bean, or some request/session/application objects that you can deal with that were not there before.
So somewhere in your JSP page you would perform some logic to determine whether or not you are to display your data.
This is, at least, how I would approach it being somewhat new to STRUTS myself. But if someone has a better approach I would be happy to hear it.
manasa teja
Ranch Hand

Joined: May 27, 2002
Posts: 325
Thanks a lot. I got ur point and am able to implement the same...
[ October 07, 2003: Message edited by: M K Raman ]
[ October 07, 2003: Message edited by: M K Raman ]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: Getting teh same JSP
 
Similar Threads
[struts 1] FormFile field in browser not refilled with file path
pagination problem
Struts Validation Problem
Struts understanding
Change of URL upon validation in jsp