[jboss-user] [JBoss Seam] - Re: Http Session Management into Seam

PatrickMadden do-not-reply at jboss.com
Tue Apr 10 16:27:43 EDT 2007


Regarding Session, you should look into the code of SeamListener.java and Lifecycle.java

I had similar issues with knowing when a session context actually became active in my components. I found the @Create annotation that you can use inside of you SFSB components that have Session Scope. You put this above a method and that method will be called when Seam fully creates your sessioned component. For example:


  |     /**
  |      * This method is called after this component has been successfully 
  |      * instantiated by the Seam framework
  |      */
  |     @Create
  |     public void create()
  |     {
  |         log.info("WebDocumentTreeModelBean create method called");
  |         
  |         if (Contexts.isSessionContextActive())
  |         {
  |             // do what ever you need to do once your session is active
  |         }
  |         else
  |         {
  |             log.info("SessionContext is still not active after component creation event");
  |         }
  |     }

You would also need to define the public void create() method in your local interface but I found this useful. I never knew exactly when Contexts.isSessionContextActive() was valid until I found this annotation.

Hope this helps.

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036120



More information about the jboss-user mailing list