Good morning Jacob,

Thanks a lot for the suggestion again. It is nice to have a work-around before 
a clean solution is implemented by the Seam development team. And I have 
learned a lot about JSF phases and Seam messages/facesMessages with your code.

Now I have the message displayed correctly when a user's session is expired. 
However, it seems that the PhaseListener also raises the session expiry event 
when a user logout. My goal is to differ these two scenarios. Is there a way to 
raise two different events with the PhaseListener?

By the way, my implementation is as follows:



          Code:
        
        
          
1. AuthenticatorAction
public void sessionExpired() {
        user.setMessage("user.session.timeout");
}  
Where user is a session scope variable. This serves as the appropriately scoped 
message component you mentioned. 

2. pages.xml
    <page view-id="/security/login.xhtml">
        
        
        
            ....
        
    

3. AuthenticatorAction
    public void displaySessionExpiredMessage() {
        if (user != null){
                if (user.getMessage() != null) {
                        
FacesMessages.instance().addFromResourceBundle(user.getMessage());
                } 
                user.setMessage(null);
        }
    }

        



Thank you very much for your help and have a nice day.

Best regards,
Sheng

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105542#4105542

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105542
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to