• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Home page should be displayed on successfull login after session expired

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am working on an application with following environment:

JSP, EJB 2.0,JBoss3.2,Windows Server 2003

I am facing a problem that if user was on a jsp say abc.jsp and session expired, now if user clicks on any link on that jsp he will be asked to enter login credentials again and after successfull authentication will be redirected to the same page (abc.jsp in this case).

I want home.jsp to be displayed to user after successfull login( and not abc.jsp) no matter what.

P.S. User logs in through login.jsp and after JAAS auhentication redirected to home.jsp

Regards

Akhil.
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure I fully understand your issue, but here is my input.

I would setup a ServletFilter rather than do everything in JSP.

As an example, if you have pages in a private area, you define a ServletFilter that runs when the URL contains the string 'PRIVATE'.(/myapp/PRIVATE/destinationpage.jsp)

In that filter, you check to see if the session has expired. If it has, you send the user to login.jsp. If the session is still valid, then you pass them through to the requested page.

login.jsp then always sends users to home.jsp if the login is successful.
 
Akhil Kashyap
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks John.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Akhil Kashyap
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi John,

Filter approach is not working as filter does not get invoked when one is using j_security_check along with JBoss.

Any other work around from any one?

Akhil.
 
I'm a lumberjack and I'm okay, I sleep all night and work all day. Lumberjack ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic