Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

how would i redirect in struts

 
Ranch Hand
Posts: 331
  • 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
 
Ranch Hand
Posts: 1312
  • 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
  • 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
  • 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.
 
    Bookmark Topic Watch Topic
  • New Topic