Solve the problem of session loss after maven's jetty plugin restarts

The maven project uses the jetty plug-in configuration, supports hot deployment, and solves the problem of restarting the session failure and requiring re-login. It is ok to change the following code to the <plugin> node of maven. ! ! !

<plugin>
     <groupId>org.eclipse.jetty</groupId>
     <artifactId>jetty-maven-plugin</artifactId>
     <version>9.4.2.v20170220</version>

     <configuration>
      <webAppSourceDirectory>/home/linye/workspace/zhongtai/webapp</webAppSourceDirectory>
      <webApp>
       <contextPath>/zhongtai</contextPath>
      </webApp>
      <httpConnector>
       <port>8080</port>
      </httpConnector>

       <!--How many seconds to check for changes-->
      <scanIntervalSeconds>0</scanIntervalSeconds>
      <sessionHandler implementation="org.eclipse.jetty.server.session.SessionHandler">
       <sessionManager
        implementation="org.eclipse.jetty .server.session.HashSessionManager">
        <!-- Session path for storing persistence-->
        <storeDirectory>doc/jetty-sessions</storeDirectory>
        <idleSavePeriod>0</idleSavePeriod>
       </sessionManager>
      </sessionHandler >
     </configuration>
    </plugin>



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325516241&siteId=291194637