Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Replacing the SessionMananger in a ServletContextListener, worked in 6, fails in 7

Shay,

I can't see anything in the stop/start code that could cause that.

try the server.dump() method to see the handler structure.

cheers


Shay Banon wrote:
> Hi,
> 
>    I use a ServletContextListener to replace the SessionManager Jetty
> uses (I need this since the knowledge of which session manager to use
> exists within the web app). The following code worked in version 6, but
> in 7, it seems like the code causes the SessionHandler to be removed
> from the chain:
> 
> ServletContextHandler jettyContext = (ServletContextHandler)
> ((ContextHandler.Context) servletContext).getContextHandler();
> SessionHandler sessionHandler = jettyContext.getSessionHandler();
> try {
>     sessionHandler.stop();
> } catch (Exception e) {
>     throw new RuntimeException("Failed to stop session handler to inject
> our own session manager", e);
> }
> 
> // ....
> 
> sessionHandler.setSessionManager(mySessionManager);
> 
> try {
>     sessionHandler.start();
> } catch (Exception e) {
>     throw new RuntimeException("Failed to start session handler to
> inject our own session manager", e);
> }
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users



Back to the top