wood burning stoves 2.0*
The moose likes Struts and the fly likes how would i redirect in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how would i redirect in struts" Watch "how would i redirect in struts" New topic
Author

how would i redirect in struts

john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
If im in page a.jsp and some error throws me to b.jsp what is the easiest way to redirect in struts. I have tried to read some tutorials but im quite strapped for time and I was hoping someone would have a simple example that I could use. I need to remember which page the user came from since it could come from any page to b.jsp not only a.jsp.

Thank you all for your time
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
you should use global action like this ::





This will help you.
[ January 24, 2005: Message edited by: somkiat puisungnoen ]

SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
Ok maybe im lost but I dont see how that will send me back to the original page once the action is completed. What I want to check is if the user is in session in any page i.e. jsp. If he is he can proceed otherwise send him to logon.jsp and once logged on send him back to the page that he was on.
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
What I want to check is if the user is in session in any page i.e. jsp.



you can do like this ::

1. check in Action Class

2. Check in jsp page ::
- use struts -tag lib :: present or notpresent
- create some util class to check that and call it in jsp page.
- create your custom taglib to do that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how would i redirect in struts
 
Similar Threads
Passing values to jsp page
The browser's refresh button cause trouble
Problem caused by pressing the 'BACK' button on the broswer
relative path confusion
Finding current URI?