开发者

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

开发者 https://www.devze.com 2023-04-12 00:53 出处:网络
We\'ve been experiencing problems with jse开发者_运维技巧ssionid 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

We've been experiencing problems with jse开发者_运维技巧ssionid 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


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>

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号