Using Ebean in a Servlet Container

To use Ebean in a Servlet Container you should specify a listener in the web.xml.

The listener is used to start up Ebean when the servlet Container starts. It also lets Ebean know to use ServletContext to read resources such as xml deployment files and sql files rather than File IO (this is necessary if the WAR file is not unpacked on deployment).

These are examples from my web.xml:


...
<web-app>

    <!-- filters etc in here ... -->

    <listener>
        <listener-class>com.avaje.ebean.server.core.ServletContextListener</listener-class>
    </listener>

    <!-- servlets etc in here ... -->

</web-app>


Introduction User Guide (pdf) Install/Configure Public JavaDoc Whitepapers
General Database Specific Byte Code Deployment Annotations Features
Top Bugs Top Enhancements
woResponse