org.mortbay.jetty.servlet.SessionHandler Java Examples

The following examples show how to use org.mortbay.jetty.servlet.SessionHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestProtocolHttpClient.java    From anthelion with Apache License 2.0 6 votes vote down vote up
protected void setUp() throws Exception {

    ContextHandler context = new ContextHandler();
    context.setContextPath("/");
    context.setResourceBase(RES_DIR);
    ServletHandler sh = new ServletHandler();
    sh.addServlet("org.apache.jasper.servlet.JspServlet", "*.jsp");
    context.addHandler(sh);
    context.addHandler(new SessionHandler());

    server = new Server();
    server.addHandler(context);

    conf = new Configuration();
    conf.addResource("nutch-default.xml");
    conf.addResource("nutch-site-test.xml");
    
    http = new Http();
    http.setConf(conf);
  }
 
Example #2
Source File: GitkitExample.java    From identity-toolkit-java with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
  Server server = new Server(4567);
  ServletHandler servletHandler = new ServletHandler();
  SessionHandler sessionHandler = new SessionHandler();
  sessionHandler.setHandler(servletHandler);
  server.setHandler(sessionHandler);
  servletHandler.addServletWithMapping(LoginServlet.class, "/login");
  servletHandler.addServletWithMapping(WidgetServlet.class, "/gitkit");
  servletHandler.addServletWithMapping(LoginServlet.class, "/");
  server.start();
  server.join();
}
 
Example #3
Source File: TestProtocolHttpClient.java    From nutch-htmlunit with Apache License 2.0 6 votes vote down vote up
protected void setUp() throws Exception {

    ContextHandler context = new ContextHandler();
    context.setContextPath("/");
    context.setResourceBase(RES_DIR);
    ServletHandler sh = new ServletHandler();
    sh.addServlet("org.apache.jasper.servlet.JspServlet", "*.jsp");
    context.addHandler(sh);
    context.addHandler(new SessionHandler());

    server = new Server();
    server.addHandler(context);

    conf = new Configuration();
    conf.addResource("nutch-default.xml");
    conf.addResource("nutch-site-test.xml");
    
    http = new Http();
    http.setConf(conf);
  }