在启动类中继承SpringBootServletInitializer,然后重写这个方法
@SpringBootApplication
public class NewscreeningApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(NewscreeningApplication.class, args);
}
//去掉url带的jsessionid
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
super.onStartup(servletContext);
servletContext.setSessionTrackingModes(Collections.singleton(SessionTrackingMode.COOKIE));
SessionCookieConfig sessionCookieConfig=servletContext.getSessionCookieConfig();
sessionCookieConfig.setHttpOnly(true);
}
}
向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti