jbossseamsessioncontext

initialize sessionContext and context


Can anyone please suggest to me how to initialize org.jboss.seam.contexts Context as well as session context inside IR?

I need to do it for my testing purposes.


Solution

  • You need to first create an application context and set the property.

    Context appContext = new ApplicationContext();
    // Set a value
    appContext.set("flagvalue", new Object());
    // Get a value
    Contexts.getSessionContext().get("flagvalue");