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.

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 .