-
1. Re: caputure loginException message from custome login module
haint Jun 27, 2012 11:18 PM (in response to rocky07)Do you want to print out to system console?
-
2. Re: caputure loginException message from custome login module
rocky07 Jun 28, 2012 1:10 AM (in response to haint)no but capture the exception message and display the same in my login.jsp
-
3. Re: caputure loginException message from custome login module
mposolda Jun 28, 2012 2:39 AM (in response to rocky07)Hi,
this is currently quite hard to achieve and you can do it only in container specific way. For example you may need to obtain HttpSession inside your login module and save the error message "inside evaluation priod" as some attribute into HttpSession. Session attribute then can be read from your login.jsp page. Especially the part with obtaining HttpSession in Login Module class is container specific. For example see this login module class https://github.com/mposolda/gatein-sso/blob/master/agent/src/main/java/org/gatein/sso/agent/login/SSOLoginModule.java where you can see how to obtain HttpServletRequest and HttpSession in login module class in JBoss server.
Hope this helps,
Marek
-
4. Re: caputure loginException message from custome login module
hoang_to Jun 28, 2012 10:47 PM (in response to rocky07)I think it is doable with Servlet 3.0.
You could create a servlet extending Servlet 3.0 API that intercepts the login request, then use the programmatic login with a try/catch block.
Another fragile solution is to store the message in a ThreadLocal variable!
-
5. Re: caputure loginException message from custome login module
toomtooms Jul 1, 2012 4:21 PM (in response to hoang_to)Can you explain why you think that the ThreadLocal solution is "fragile" ?
-
6. Re: caputure loginException message from custome login module
hoang_to Jul 2, 2012 5:15 AM (in response to toomtooms)Thomas Delhoménie wrote:
Can you explain why you think that the ThreadLocal solution is "fragile" ?
For this problem, it is sure that ThreadLocal woud help. I said 'fragile' just because i dislike such solution.
-
7. Re: caputure loginException message from custome login module
rocky07 Jul 14, 2012 8:44 AM (in response to hoang_to)hey ..
any clues on how to make my session inside gatein.ear be accessible in the portlet application ..
String id = (String) request.getPortletSession().getAttribute("authorised", PortletSession.APPLICATION_SCOPE);
here "request" is Renderrequest of the doView inside generic portlet class, but all i get is null. I am setting the session inside my custom login class which is inside my gatein.ear and am planning to access the session from RenderRequest inside the doView() .
i tried httpsession replication ,using <distributable/> atribute in my application war, but it gives me deployment exception , am confused if that sthe right way to make my session avaliavle inside the portlet method .
-
8. Re: caputure loginException message from custome login module
hoang_to Jul 15, 2012 9:54 PM (in response to rocky07)The code setting your attribute on PortletSession need to be in the same portlet application as your portlet.