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>