[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
CC Spring Boot session tracking  XML
Forum Index -> Deployment
Author Message
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5258
Offline

(from mail conversation)

You are used to defining the servlet engine's session tracking mode by corresponding definitions in web.xml.

In Spring Boot you have to do so by API: example

Code:
 package springbootstartup;
 
 import java.util.HashSet;
 import java.util.Set;
 
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
 import javax.servlet.SessionTrackingMode;
 
 import org.eclnt.jsfserver.util.CCInitialize;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.web.servlet.ServletContextInitializer;
 import org.springframework.context.annotation.Bean;
 
 @SpringBootApplication
 public class SBApplication
 {
     public static void main(String[] args) 
     {
         SpringApplication.run(SBApplication.class, args);
     }
 
     @Bean
     public ServletContextInitializer initializer() 
     {
         return new ServletContextInitializer() 
         {
             @Override
             public void onStartup(ServletContext servletContext) throws ServletException 
             {
                 Set<SessionTrackingMode> stms = new HashSet<SessionTrackingMode>();
                 stms.add(SessionTrackingMode.URL);
                 servletContext.setSessionTrackingModes(stms);
                 CCInitialize.initializeCCEnvironment(servletContext);
             }
         };
     }
 }
 


This is the default you nee to define for URL session tracking mode.

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Deployment
Go to:   
Powered by JForum 2.1.6 © JForum Team