[jboss-user] [JBoss Seam] - Re: @Startup (possible to have this occur post session creat

courtneycouch do-not-reply at jboss.com
Mon Apr 30 06:03:32 EDT 2007


"petemuir" wrote : Seam's session context is driven by the web application. Seam is notified when the session has been created and processes the creation of @Startup @Scope(SESSION) components. We are calling the hooks as late as possible afaics.
  | 
  | What are you trying to do - which methods? What is going wrong - whats the stack?

I'm trying to initialize some managed-beans configured in faces-config.

The reason for this is that ajax4jsf mediaOutput components cant be seam component.  They need to be simply managed-beans.  When I'm using managed-beans in a seam application the regular lifecycle stuff for managed-beans doesnt work since seam is in control.

What I was trying to do instead was simply (from inside a seam component)

fc.getApplication().getVariableResolver().resolveVariable("manageBean")

to get ahold of the managed bean,  then inside the managed bean:

org.jboss.seam.contexts.Contexts.getSessionContext().get("someComponent")

So the managed-bean would simply be a facade into the real seam component that its calling.  (as a workaround to ajax4jsf not letting me use seam components).

I need to have access to the seam contexts from the managed-bean and if I dont initialize the managed-bean from a seam component then org.jboss.seam.contexts.Contexts.getSessionContext().get() throws a null error.

Kind of a hack I suppose.. the problem is fc.getApplication().getVariableResolver().resolveVariable() called from within a @Create method of a component tahts marked @Startup just starts an infinite loop.

When I simply instantiate the seam component manually everything works perfectly.. the ajax4jsf stuff.. the managed-bean, etc. 

Maybe I'm going about this the wrong way?

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

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



More information about the jboss-user mailing list