Set tracking mode to cookie to remove appended session id, without using web.xml

前端 未结 4 1550
失恋的感觉
失恋的感觉 2020-12-29 16:43

I am setting up a completely java based spring app with no xml config :

public class WebApp extends AbstractAnnotationConfigDispatcherServletInitializer {
           


        
4条回答
  •  不知归路
    2020-12-29 17:13

    Another solution, that works for me, has been the code below inside the SecurityConfig class.

    @Override
    protected void configure(HttpSecurity http) throws Exception {    
     http.httpBasic()
      .and()
      .sessionManagement()
      .sessionCreationPolicy(SessionCreationPolicy.STATELESS) //No sessionId eppended  
      ...
    }
    

提交回复
热议问题