I am setting up a completely java based spring app with no xml config :
public class WebApp extends AbstractAnnotationConfigDispatcherServletInitializer {
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 ... }