code
docs
tests
This library provide the necessary boilerplate code to bootstrap a Zest™ Application in a Servlet container plus some facilities. It aims at a very simple need and is provided as an example integration.
If instead you want to run a servlet container inside a Zest™ Application, see HTTP Library.
Extends AbstractZestServletBootstrap
to easily bind a Zest™ Application
activation/passivation to your webapp
lifecycle.
Use ZestServletSupport#application(javax.servlet.ServletContext)
to get a handle on the Application
from the
ServletContext
.
Here is an example ServletContextListener:
public static class FooServletContextListener extends AbstractZestServletBootstrap { public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory ) throws AssemblyException { ApplicationAssembly appass = applicationFactory.newApplicationAssembly(); [...snip...] return appass; } }
ZestServlet
and ZestFilter
respectively provide base class for easy access to the Application
from the
ServletContext
.
Here is a sample servlet that simply output the assembled Application name:
public static class FooServlet extends ZestServlet { @Override protected void doGet( HttpServletRequest req, HttpServletResponse resp ) throws ServletException, IOException { // Output the assembled Application's name as an example resp.getWriter().println( application().name() ); } }