Search in sources :

Example 1 with CdiServletRequestListener

use of org.apache.deltaspike.cdise.servlet.CdiServletRequestListener in project deltaspike by apache.

the class JettyTest method createServer.

@Override
protected int createServer() throws Exception {
    int port = super.getPort();
    server = new Server(port);
    ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
    context.setContextPath("/");
    server.setHandler(context);
    context.addEventListener(new CdiServletRequestListener());
    context.addServlet(new ServletHolder(new RequestServlet()), "/*");
    server.start();
    return port;
}
Also used : Server(org.eclipse.jetty.server.Server) CdiServletRequestListener(org.apache.deltaspike.cdise.servlet.CdiServletRequestListener) ServletHolder(org.eclipse.jetty.servlet.ServletHolder) ServletContextHandler(org.eclipse.jetty.servlet.ServletContextHandler) RequestServlet(org.apache.deltaspike.cdise.servlet.test.content.RequestServlet)

Aggregations

CdiServletRequestListener (org.apache.deltaspike.cdise.servlet.CdiServletRequestListener)1 RequestServlet (org.apache.deltaspike.cdise.servlet.test.content.RequestServlet)1 Server (org.eclipse.jetty.server.Server)1 ServletContextHandler (org.eclipse.jetty.servlet.ServletContextHandler)1 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)1