use of org.apache.deltaspike.cdise.servlet.test.content.RequestServlet 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;
}
use of org.apache.deltaspike.cdise.servlet.test.content.RequestServlet in project deltaspike by apache.
the class TomcatTest method createServer.
@Override
protected int createServer() throws Exception {
String baseDir = "target/webapp-runner";
tomcat = new Tomcat();
int port = super.getPort();
tomcat.setPort(port);
File base = new File(baseDir);
if (!base.exists()) {
base.mkdirs();
}
tomcat.setBaseDir(baseDir);
Context ctx = tomcat.addContext("/", base.getAbsolutePath());
StandardContext standardContext = (StandardContext) ctx;
standardContext.addApplicationListener(CdiServletContextListener.class.getName());
Wrapper wrapper = Tomcat.addServlet(ctx, "RequestServlet", RequestServlet.class.getName());
wrapper.addMapping("/*");
tomcat.start();
return port;
}
Aggregations