3 Replies Latest reply: Sep 26, 2007 5:49 AM by 807600 RSS

    Redirect the URL


      In my application if the user is invoking any page like inbox page or list of files page
      if the user is already loged in the URL should go to the appropriate page.
      If the user is not loged in it will redirect to login page.
      How I can do that ?? I need help from your side.

      For example..

      this is the URL. But this is not login page URL. User has invoking different URL for my application.


      It should check the user is already loged in
      if(already loged in){
      Inbox page
      login page
      Thanks in advance.....
        • 1. Re: Redirect the URL
          Use servlet filters for this kind of security check.
          • 2. Re: Redirect the URL
            hi friend,

            I dont know my idea is the efficient way to do this, tell me if any other way to acheive this.

            1. write a jsp file which will check for an attribute in the session.
            String str=(String)session.getAttribute("login_name");
            /* dispatch the request to login page*/
            2. include the logincheck.jsp file in all other jsp files say, inbox.jsp,outbox.jsp,...etc...

            3.in the login page once the user enter the user name and password, check valid user or not, if he is a valid user then set the attribute "login_name" in the session.

            4.in logout page, remove the "login_name" attribute from the session.
            • 3. Re: Redirect the URL
              Hi Rajaram ,

              Thanks for your prompt reply....

              I'm trying that way only. If I will get any trouble on this .. I will keep on post in this forum... Please check and update.