Created
October 24, 2016 16:03
-
-
Save paul58914080/3eeee0f1c90a3e9aeb6da32acbfa631f to your computer and use it in GitHub Desktop.
Configuration with spring boot for new console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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