Skip to main content

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

Thank you for Jetty.  You all know I'm a fan.

I read this:
"In the absence of any explicit configuration, Jetty will instantiate an instance of the DefaultSessionCache per context."

But when I go to handle a request in an AbstractHandler implementation:

    override fun handle(
                        target: String,
                        baseRequest: Request,
                        request: HttpServletRequest,
                        response: HttpServletResponse
     ) {
         request.getSession(true)


I get an exception:
java.lang.IllegalStateException: No SessionManager
at org.eclipse.jetty.server.Request.getSession(Request.java:1605)

Does it actually need to be configured, or am I doing something else wrong?  Also, can it be configured in code (Java/Kotlin)?

This wasn't something I ever thought about with Tomcat.  Is this because I'm extending AbstractHandler instead of HttpServlet?

--
Glen K. Peterson
(828) 393-0081

Back to the top