How do you disable jsessionid for Jetty running with the Eclipse Jetty Maven plugin?
Asked Answered
H

1

7

We've been experiencing problems with jsessionid and I'm trying to figure out a way to disable this. Would anybody happen to know how you can do this using the org.mortbay.jetty:jetty-maven-plugin:7.x.x? So far, all I've come across are ways to do it using the old plugin from Mortbay whose settings are incompatible with Eclipse's version.

Thanks in advance,

Martin

Hong answered 11/10, 2011 at 14:19 Comment(0)
H
11

Submitting answer to my own question due to the fact that nobody seems to have an answer for this and I am sure someone else will eventually find it useful as well, because all the other examples of how to do this were for the old maven-jetty-plugin (<7.x).

After digging through Jetty's code for a while, I found out that the variable had been renamed as shown below:

<build>
    <plugins>
        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>${version.jetty}</version>
            <configuration>
                <webAppConfig>
                    <contextPath>/foo</contextPath>

                    <sessionHandler implementation="org.eclipse.jetty.server.session.SessionHandler">
                        <sessionManager implementation="org.eclipse.jetty.server.session.HashSessionManager">
                            <!-- Disable url sessions using JSessionID -->
                            <sessionIdPathParameterName>none</sessionIdPathParameterName>
                        </sessionManager>
                    </sessionHandler>
                </webAppConfig>
            </configuration>
        </plugin>

    <plugins>

</build>

Hong answered 11/10, 2011 at 14:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.