Monday, December 21, 2009

Using OpenWebBeans in Web Containers

Hi;

OpenWebBeans has been developing as a modular and pluggable way from the start. Core "Dependency Injection" functionality is not dependent on any Java EE requirements. Therefore, it can be configured easily to work on any Java Web Containers like Tomcat, Jetty etc. or Java SE like Swing.

To configure OpenWebBeans in a web application based on JSP or JSF,
  1. Put empty "beans.xml" marker file into "WEB-INF" directory of the web application
  2. Update your web application "web.xml" file with following snippet
      <listener>
      <listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
       </listener>

That is all! Now you can use JSR-299 functionality in your application.

Stay with OpenWebBeans :)

--Gurkan

No comments: