Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 867
carlspring Avatar asked Oct 11 '11 14:10

carlspring


1 Answers

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>

like image 144
carlspring Avatar answered Nov 10 '22 13:11

carlspring