use of org.springframework.boot.web.servlet.ServletRegistrationBean in project ocvn by devgateway.
the class JMXConfiguration method jminiXServletRegistration.
@Bean
public ServletRegistrationBean jminiXServletRegistration(final MiniConsoleApplication miniConsoleApplication) {
ServletRegistrationBean registration = new ServletRegistrationBean(new SpringMiniConsoleServlet());
registration.addUrlMappings("/jminix/*");
return registration;
}
use of org.springframework.boot.web.servlet.ServletRegistrationBean in project camel by apache.
the class ServletMappingAutoConfiguration method servletRegistrationBean.
@Bean
ServletRegistrationBean servletRegistrationBean(ServletMappingConfiguration config) {
ServletRegistrationBean mapping = new ServletRegistrationBean();
mapping.setServlet(new CamelHttpTransportServlet());
mapping.addUrlMappings(config.getContextPath());
mapping.setName(config.getServletName());
mapping.setLoadOnStartup(1);
return mapping;
}
use of org.springframework.boot.web.servlet.ServletRegistrationBean in project camel by apache.
the class Application method camelServletRegistrationBean.
@Bean
public ServletRegistrationBean camelServletRegistrationBean() {
ServletRegistrationBean registration = new ServletRegistrationBean(new CamelHttpTransportServlet(), "/camel/*");
registration.setName("CamelServlet");
return registration;
}
use of org.springframework.boot.web.servlet.ServletRegistrationBean in project cas by apereo.
the class CoreWsSecuritySecurityTokenServiceConfiguration method cxfServlet.
@Bean
public ServletRegistrationBean cxfServlet() {
final ServletRegistrationBean bean = new ServletRegistrationBean();
bean.setEnabled(true);
bean.setName("cxfServletSecurityTokenService");
bean.setServlet(new CXFServlet());
bean.setUrlMappings(Collections.singleton(WSFederationConstants.ENDPOINT_STS.concat("*")));
bean.setAsyncSupported(true);
return bean;
}
use of org.springframework.boot.web.servlet.ServletRegistrationBean in project spring-boot by spring-projects.
the class UndertowServletWebServerFactoryTests method testAccessLog.
private void testAccessLog(String prefix, String suffix, String expectedFile) throws IOException, URISyntaxException, InterruptedException {
UndertowServletWebServerFactory factory = getFactory();
factory.setAccessLogEnabled(true);
factory.setAccessLogPrefix(prefix);
factory.setAccessLogSuffix(suffix);
File accessLogDirectory = this.temporaryFolder.getRoot();
factory.setAccessLogDirectory(accessLogDirectory);
assertThat(accessLogDirectory.listFiles()).isEmpty();
this.webServer = factory.getWebServer(new ServletRegistrationBean<>(new ExampleServlet(), "/hello"));
this.webServer.start();
assertThat(getResponse(getLocalUrl("/hello"))).isEqualTo("Hello World");
File accessLog = new File(accessLogDirectory, expectedFile);
awaitFile(accessLog);
assertThat(accessLogDirectory.listFiles()).contains(accessLog);
}
Aggregations