4 Replies Latest reply on Sep 30, 2005 11:33 AM by ryan dewell

    Problem setting context variables programmatically (in a Vie

    ryan dewell Novice

      I have a custom ViewHandler implementation that needs to setup a conversation bean in the createView method. The problem is that I can't find a good way to do this that ALSO "activates" the conversation context... i.e. adds it to the conversation context. My bean is annotated:


      In my view handler, I acquire the bean in createView using JNDI:

      ... lookup(AppView.class.getName())

      This works fine. I now have an instance to my AppView bean, and I perform the needed "setup". Now, how do I make Seam aware of AppView...? I can't set it in the Contexts.getConversationContext() myself because that context is not yet "active". And, it isn't "automatically" available in the conversation context either.

      I've also tried acquiring the bean a different way than JNDI, using a pure JSF expression. But, I get a similar problem. This type in the form of an exception: Caused by: java.lang.IllegalStateException: No conversation context active.

      In short, I guess I need to know a way to programmatically populate and/or activate the conversation context for this specific circumstance.