java - Inject beans from other projects into Vaadin view -
in 1 of vaadin views i'm trying hold of business object resides in project (bll) injecting @inject.
vaadin view:
public class fruitsaladview extends verticallayout implements view { @inject bananaservice bananaservice; ... }
i can't this, of course, bananaservice object null @ runtime, because have component-scan packages.
i'm using annotations have no web.xml in vaadin web project, don't have web-inf folder.
i know there alternatives, cdi-utils , vaadin cdi vaadin addons, some other solutions this, seem inject stuff main ui (not views) , web application itself, not other modules.
i'm using vaadin 7 , tomcat 7 (as long it's feasible using tomcat given answer question below)
question: recommended way inject bean module vaadin view , need in order accomplish this?
follow-up question: using tomcat application problem after using above method?
tomcat servlet container, if want use cdi must use jee6 compliant server, tomee or jboss. if interested in best practices integration vaadin , cdi, recommend start with: http://www.adam-bien.com/roller/abien/entry/essential_vaadin_7_java_ee
you wrote want inject beans vaadin views directly. analyze example code https://github.com/vaadin/cdi/blob/master/vaadin-cdi-example/src/main/java/com/vaadin/cdi/example/view/rootview.java learn how vaadin-cdi add-on
Comments
Post a Comment