users@glassfish.java.net

simple redirect and direct jsp access question

From: <glassfish_at_javadesktop.org>
Date: Fri, 06 Feb 2009 07:30:53 PST

Guys,

I have 3 jsp pages (login.jsp, index.jsp, agree.jsp). login.jsp is the welcome file.
Alright now when the user tries to access any of the above pages without signing in, they are taken back to login.jsp. Works fine. I have all the correct settings in web.xml and faces-config.xml for navigation and other stuff. I hope so...

Now...when the user successfully logs into the site using through login.jsp page...I check a current user attribute to see if he is to be redirected to agree.jsp or to index.jsp.

For that purpose, I have created a servlet called agreeServlet. And in the processRequest method, I get the session and check the current user attribute and redirect either to agree.jsp or index.jsp...works fine no problem here....

BUT NOW HERE IS MY QUESTION:

When a user logs in successfully and gets redirected to agree.jsp...the user can type the URL for index.jsp directly into the address bar and can access the index.jsp page. Nothing is stopping him because he has successfully logged into the site. I WANT TO AVOID A DIRECT ACCESS TO THE INDEX.JSP PAGE?

how do I set this up...I want user to agree to the terms on agree.jsp, which then redirects him to the index.jsp page...

thanks

-Amor
[Message sent by forum member 'amorous' (amorous)]

http://forums.java.net/jive/thread.jspa?messageID=330541