package de.otto.edison.togglz.configuration;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.togglz.console.TogglzConsoleServlet;

@Configuration
public class TogglzWebConfiguration {
    
    @Bean
    public ServletRegistrationBean togglzServlet(@Value("${management.context-path:/internal}") String prefix) {
        return new ServletRegistrationBean(new TogglzConsoleServlet(), prefix + "/togglz/*");
    }
}

@@ -99,16 +99,89 @@
 .Value;%0A
+import org.springframework.boot.context.embedded.FilterRegistrationBean;%0A
 import o
@@ -238,32 +238,32 @@
 gistrationBean;%0A
-
 import org.sprin
@@ -406,16 +406,56 @@
 Servlet;
+%0Aimport org.togglz.servlet.TogglzFilter;
 %0A%0A@Confi
@@ -501,20 +501,308 @@
 ation %7B%0A
+%0A
     
+@Bean%0A    public FilterRegistrationBean togglzFilter() %7B%0A        FilterRegistrationBean filterRegistration = new FilterRegistrationBean();%0A        filterRegistration.setFilter(new TogglzFilter());%0A        filterRegistration.addUrlPatterns(%22/*%22);%0A        return filterRegistration;%0A    %7D%0A
 %0A    @Be

Revert "Make Togglz compatible to not embedded Tomcat"