Announcement Announcement Module
Collapse
No announcement yet.
session expiry and redirecting to login page Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • session expiry and redirecting to login page

    I've developed a portal using spring with jetspeed as the portal server.

    I'm facing a problem wherein if the user is idle for quite sometime, then session expires and if the user performs some operation on portal it will throw null pointer exception as i'm getting user object from session in every page.

    I want the portal to behave in a way that if session expires and if user performs any operation, it should redirect to login page.

    How to achieve the above. Please help.

  • #2
    Use Filter

    The easiest way is to use Servlet Filter which is one of J2EE specifications.

    Check for the user object in the filter and redirect to login page when it's null.

    http://javaboutique.internet.com/tut...rvlet_Filters/

    Comment


    • #3
      I'm using spring portal framework. Will filter suits here too?

      Comment


      • #4
        Use Portlet filter

        Ooops.. So yours is not a simple web-app, but a portal app.

        U can use portlet filter instead.

        http://publib.boulder.ibm.com/infoce...letfilter.html

        Comment


        • #5
          SOrry for the doubt again.

          I just saw the link you sent on portlet filters.

          IT says it need to be used with IBM compliant portlet api. I'm using spring portlet framework with jetspeed. Will it still work?

          Comment


          • #6
            Extend DispatcherPortlet

            Ok. The suitable idea is to extend the DispatcherPortlet of Spring Portlet MVC Framework and override the doDispatch() method to make the check.

            Comment


            • #7
              Did you mean, doRenderResponse() method? B'coz i don't see any doDispatch method there.

              Comment

              Working...
              X