THANK YOU VERY MUCH FREDDY!!!

 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Freddy
Daoud
Sent: Wednesday, September 17, 2008 11:37 AM
To: [email protected]
Subject: Re: [Stripes-users] Authentication/Authorization

Hi Myles,

In the example that you have posted, look at the SecurityFilter class.
This is what intercepts requests and determines if the user is
authenticated, by the presence of the "user" attribute in the
HttpSession.

Now, the publicUrls variable holds a Set of URLs that are allowed
without having to login. In your example, you want an attempted access
to profile.jsp to go to your login page, login.jsp, if the user has not
logged in. However, you have listed profile.jsp in publicUrls, so the
filter lets the request go through. Remove or comment out that line, and
you will see that clicking on your initial link will indeed bring you to
your login page.

SecurityFilter.java
-------------------

private static Set<String> publicUrls = new HashSet<String>();

static
{
        publicUrls.add("/login.jsp");
        // publicUrls.add("/profile.jsp"); <-- comment out this line
        publicUrls.add("/index.jsp");
        publicUrls.add("/my/lock/Login.action");
}

Hope that helps.

Cheers,
Freddy
http://www.stripesbook.com


-
-
- Good Day to All!
-
- Attached are the files from Bugzooky and some mine. I made this to
know
- how the authentication
- of the Bugzooky program works but I am having a problem understanding
- why it does not go to the
- login page even if I have not yet login.
-
- Can somebody please help.
- I would greatly appreciate it if somebody could enlighten me on this.
-
- Below is the directory structure.
-
- WebContent
-      |___ META-INF
-      |        |___MANIFEST.MF
-      |
-      |___ WEB-INF
-      |        |___ classes
-      |        |      |___ com
-      |        |             |___ my
-      |        |                   |___ lock
-      |        |                          |___LoginActionBean.class
-      |        |                          |___MyActionBean.class
-      |        |                          |___MyActionBeanContext.class
-      |        |                          |___Person.class
-      |        |                          |___PersonManager.class
-      |        |                          |___SecurityFilter.class
-      |        |      
-      |        |      
-      |        |      
-      |        |___ lib
-      |              |___commons-logging.jar
-      |              |___cos.jar
-      |              |___stripes.jar
-      |        
-      |        
-      |___index.jsp        
-      |___login.jsp
-      |___profile.jsp
-
- Thanks and Regards,
- Myles


------------------------------------------------------------------------
-
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge Build the coolest Linux based applications with Moblin SDK &
win great prizes Grand prize is a trip for two to an Open Source event
anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to