wood burning stoves 2.0*
The moose likes Struts and the fly likes Getting teh same JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
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
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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.


GenRocket - Experts at Building Test Data
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://aspose.com/file-tools
 
subject: Getting teh same JSP