Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: validate pages?

  1. #1
    Senior Coder jerry62704's Avatar
    Join Date
    Oct 2007
    Location
    Springfield, IL
    Posts
    1,100
    Thanks
    13
    Thanked 87 Times in 87 Posts

    Question validate pages?

    How do I validate pages such that I know they came into them from the logon page? We are using JSP and struts.

    I guess I'm asking how to set a session variable (and where - form, action?) and how to read that before the next page (and where) is presented to make sure the client came in through the login page and not with a direct URL.
    .
    .
    ...and gladly would he learn and gladly teach

    Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    you could set the authentication status in the session and check it for each request using a filter. you can set up some exclude links to allow the user to initially login etc. using init-param elements
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #3
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,994
    Thanks
    120
    Thanked 76 Times in 76 Posts
    mybe u should look at this in this way:
    if in seesion u have stored that session user has successfuly logged in, then no metter from which page he has come, or m'I wrong ?

  • #4
    Senior Coder jerry62704's Avatar
    Join Date
    Oct 2007
    Location
    Springfield, IL
    Posts
    1,100
    Thanks
    13
    Thanked 87 Times in 87 Posts
    Thanks for the comment. I was able to add:

    <&#37;
    String x = session.getAttribute("RINLogon").toString();
    if (x.equalsIgnoreCase("false")) {
    response.sendRedirect("RINLogin.jsp");
    }
    %>

    allowing me to access the session object from each of the .jsp pages. Then I set it in an action (we are using struts) to the good condition after verifying the id/password from the database. In the first page (login) I set it to false.
    .
    .
    ...and gladly would he learn and gladly teach

    Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •