View Full Version : validate pages?

07-10-2008, 10:37 PM
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.

07-12-2008, 09:47 PM
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

07-14-2008, 06:37 AM
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 ?

07-14-2008, 06:30 PM
Thanks for the comment. I was able to add:

String x = session.getAttribute("RINLogon").toString();
if (x.equalsIgnoreCase("false")) {

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.