Skip to content

Instantly share code, notes, and snippets.

@paul58914080
Created October 24, 2016 16:03
Show Gist options
  • Save paul58914080/3eeee0f1c90a3e9aeb6da32acbfa631f to your computer and use it in GitHub Desktop.
Save paul58914080/3eeee0f1c90a3e9aeb6da32acbfa631f to your computer and use it in GitHub Desktop.
Configuration with spring boot for new console
package org.ff4j.sample.config;
import org.ff4j.FF4j;
import org.ff4j.web.FF4jDispatcherServlet;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class FF4JWebConfig extends SpringBootServletInitializer {
@Bean
public ServletRegistrationBean ff4jDispatcherServletRegistrationBean(FF4jDispatcherServlet ff4jDispatcherServlet) {
return new ServletRegistrationBean(ff4jDispatcherServlet, "/new-ff4j-console");
}
@Bean
public FF4jDispatcherServlet getFF4jDispatcherServlet(FF4j ff4j) {
FF4jDispatcherServlet ff4jConsoleServlet = new FF4jDispatcherServlet();
ff4jConsoleServlet.setFf4j(ff4j);
return ff4jConsoleServlet;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment