>
> I wonder what the use would be for the request, session, and conversation
> scopes in wicket since these are already managed expiicitly in wicket. At
> least, I wouldn't see a great need for such scopemanagement by the
> container. It would be nice however if CDI could be used to inject EJBs,
> resources, and OSGI services into pages.
>
>

Sorry for the mail bombing but just got @EJB injection to work based on the
weld-wicket integration. With this setup the only thing I am missing is
probably the long-lived convesations support, but that is not essential for
me. Essential is the link to ejbs and container resources and the converged
container support in Java EE6 which will simplify a lot.

The main trick is to register only the component instantiation listener from
weld-wicket in the application class.

class WicketApplication extends WebApplication {

   private NonContextual<WeldComponentInstantiationListener>
weldComponentInstantiationListener;

    /**
     * Constructor
     */
    public WicketApplication() {
        // Empty.
    }

    @Override
    protected void init() {
        BeanManager mgr = BeanManagerLookup.getBeanManager();
        System.out.println("BeanManager '" + mgr + "'");
        this.weldComponentInstantiationListener = new
NonContextual<WeldComponentInstantiationListener>(BeanManagerLookup.getBeanManager(),
WeldComponentInstantiationListener.class);

addComponentInstantiationListener(weldComponentInstantiationListener.newInstance().produce().inject().get());
    }
    ...
}


Next is simply the use of @EJB in a regular page object.

This works without having to patch the application server.

Reply via email to