• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how would i redirect in struts

 
john mattucci
Ranch Hand
Posts: 331
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should use global action like this ::





This will help you.
[ January 24, 2005: Message edited by: somkiat puisungnoen ]
 
john mattucci
Ranch Hand
Posts: 331
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic