Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Enabling Session

Hello everyone,

I'm starting a new project with jetty and after reading jetty documentation I picked ContextHandler to implement what I need.

My question is: is there someway to have Session and Cookies suport (with HashSessionManager for example) together with ContextHandler?

I know that ServletContextHandler will give me Session suppor but my code does not work.

        Server server = new Server(8080);

        ServletContextHandler context = new ServletContextHandler(server,"/",ServletContextHandler.SESSIONS);
        context.setContextPath("/");
        context.setResourceBase(".");
        context.setClassLoader(Thread.currentThread().getContextClassLoader());
        context.setHandler(new Adapter(BasicApp.class)); // Adapter extends AbstractHandler
       
        server.setHandler(context);


Can anyone help me?

Thanks,
Felipe

Back to the top