Setting emptySessionPath = true in the Tomcat container

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Setting emptySessionPath = true in the Tomcat container


I am trying to update our large 1.3.4 grails application to 2.0.4. I spent the day on it, fixed a lot of problems, but still have issues. My main problem right now is that Jetty-1.2-SNAPSHOT, that we used on 1.3.4, seems to be no longer available in 2.0.x. And anyway we would like to switch to Tomcat as the embedded container.

However we absolutely need to have the emptySessionPath="true" attribute set for the Connector. Usually it's done on server.xml, and that's what we use in production.

I tried the following in _Events.groovy:

eventConfigureTomcat =
        def tomcat ->

        def connector = new Connector("org.apache.coyote.http11.Http11NioProtocol")
        connector.port = System.getProperty("server.port", "8080").toInteger()
        connector.redirectPort = 8443
        connector.protocol = "HTTP/1.1"

        connector.setProperty("emptySessionPath", "true")

     // I also tried the following lines, none work

        //connector.emptySessionPath = "true"
        //connector.setProperty("emptySessionPath", true)
        //connector.setAttribute("emptySessionPath", "true")
        //connector.setAttribute("emptySessionPath", true)

        tomcat.connector = connector

I would really appreciate help, as I am currently out of ideas to make this work...