Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

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.
 
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic