Sep 22, 2015
Oct 4, 2015
N/A Views
MD
warning
この記事は2年以上前に更新されたものです。情報が古くなっている可能性があります。

Add the following configuration to your JavaConfig:

@Bean
ServletContextInitializer servletContextInitializer() {
    // keep session only in cookie so that jsessionid is not appended to URL.
    return servletContext -> servletContext.setSessionTrackingModes(
            Collections.singleton(SessionTrackingMode.COOKIE));
}

This is equivalent to

<session-config>
    <tracking-mode>COOKIE</tracking-mode>
</session-config>

in web.xml

Postscript 2015-10-04

Awesome!

Found a mistake? Update the entry.
Share this article: