-
1. Re: A filter for the login servlet
hoang_to Jun 3, 2012 9:48 PM (in response to andy00)PortalRequestContext is single-request object that exists as the code handling HTTP request enters WebUI layer. As the code of your filter is executed, the PortalRequestContext has not been created on request handling thread yet. So it is always null there!
To get the username, you could simply use the method getRemoteUser from HttpServletRequest.
-
2. Re: A filter for the login servlet
andy00 Jun 4, 2012 4:47 AM (in response to hoang_to)Thanks for the reply.
Well, actually I need the user profile and I solved by calling a static method within the portlets war.
Now I want to do some operations if the login is successful or not. How could I realize it from my filter?
-
3. Re: A filter for the login servlet
hoang_to Jun 4, 2012 5:28 AM (in response to andy00)1 of 1 people found this helpfulWell, actually I need the user profile and I solved by calling a static method within the portlets war.
To get the user profile, you could go through OrganizationService component. The service components are available even before Tomcat 's Http connector!
Now I want to do some operations if the login is successful or not. How could I realize it from my filter?
I don't think a filter is suitable for that. You should implement a JAAS login module, and put your operations in the commit() method. Then configure your login module in gatein-domain JAAS entry.
-
4. Re: A filter for the login servlet
andy00 Jun 4, 2012 9:30 AM (in response to hoang_to)I don't think a filter is suitable for that. You should implement a JAAS login module, and put your operations in the commit() method. Then configure your login module in gatein-domain JAAS entry.
That's exactly what I wanted to know
Could you report some good online resources?