Web Container / GAE My GAE Demo, http://tcm-es.appspot.com/welcome.jsf web.xml<listener> <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class> </listener> beans.xml<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://java.sun.com/xml/ns/javaee"
</beans> LibraryCompile
Runtime
Reference you may consider taking advantage of the capabilities offered by the Contexts and Dependency Injection (JSR-299) (CDI) framework (theJSR was referred to as "Web Beans" prior to January 26, 2009). CDI provides similarly named @ApplicationScoped, @SessionScoped, @RequestScoped annotations (part of thejavax.enterprise.context package) but uses a @Named annotation in favor of the JSF 2.0 @ManagedBean annotation. CDI also introduces the @ConversationScopedannotation which is familiar to Seam aficionados and provides a variable-length scope that can span requests but isn't as long-lived as either the Session or Application scope. If you are interested in incorporating the CDI framework into your App Engine project, have a look a the "Configuring JBoss Weld to Run with JavaServer Faces on the Google App Engine" after completing this tutorial. |
C02.CDI/Bean Validation > 01.CDI(上下文與依賴注入) >