@@ -0,0 +1,1604 @@
+package hello;%0A%0Aimport javax.servlet.ServletContext;%0Aimport javax.servlet.ServletException;%0A%0Aimport net.bull.javamelody.MonitoringFilter;%0Aimport net.bull.javamelody.Parameter;%0Aimport net.bull.javamelody.SessionListener;%0A%0Aimport org.springframework.boot.context.embedded.FilterRegistrationBean;%0Aimport org.springframework.boot.context.embedded.ServletContextInitializer;%0Aimport org.springframework.context.annotation.Bean;%0Aimport org.springframework.context.annotation.Configuration;%0Aimport org.springframework.context.annotation.ImportResource;%0A%0A/**%0A * @author speralta, evernat%0A */%0A@Configuration%0A@ImportResource(%22classpath:net/bull/javamelody/monitoring-spring.xml%22)%0Apublic class JavaMelodyConfiguration implements ServletContextInitializer %7B%0A%09@Override%0A%09public void onStartup(ServletContext servletContext) throws ServletException %7B%0A%09%09servletContext.addListener(new SessionListener());%0A%09%7D%0A%0A%09@Bean%0A%09public FilterRegistrationBean javaMelody() %7B%0A%09%09FilterRegistrationBean javaMelody = new FilterRegistrationBean();%0A%09%09javaMelody.setFilter(new MonitoringFilter());%0A%09%09javaMelody.setName(%22monitoring%22);%0A%0A%09%09// see the list of parameters:%0A%09%09// https://github.com/javamelody/javamelody/wiki/UserGuide#6-optional-parameters%0A%09%09javaMelody.addInitParameter(Parameter.LOG.getCode(), Boolean.toString(true));%0A%09%09// to add basic auth:%0A%09%09// javaMelody.addInitParameter(Parameter.AUTHORIZED_USERS.getCode(), %22admin:pwd%22);%0A%09%09// to change the default storage directory:%0A%09%09// javaMelody.addInitParameter(Parameter.STORAGE_DIRECTORY.getCode(), %22/tmp/javamelody%22);%0A%0A%09%09javaMelody.addUrlPatterns(%22/*%22);%0A%09%09return javaMelody;%0A%09%7D%0A%7D%0A

add javamelody config for spring-boot