本文整理汇总了Java中org.springframework.boot.web.servlet.ServletRegistrationBean.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java ServletRegistrationBean.setEnabled方法的具体用法?Java ServletRegistrationBean.setEnabled怎么用?Java ServletRegistrationBean.setEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.boot.web.servlet.ServletRegistrationBean
的用法示例。
在下文中一共展示了ServletRegistrationBean.setEnabled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cxfServlet
import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@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;
}
示例2: registration
import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean
public ServletRegistrationBean registration(HystrixMetricsStreamServlet servlet) {
ServletRegistrationBean registrationBean = new ServletRegistrationBean();
registrationBean.setServlet(servlet);
registrationBean.setEnabled(true);
registrationBean.addUrlMappings("/hystrix.stream");
return registrationBean;
}
示例3: servletRegistration
import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean
ServletRegistrationBean servletRegistration(DruidStatProperties druidStatConfig) {
ServletRegistrationBean filterRegistration = new ServletRegistrationBean(new StatViewServlet());
filterRegistration.setAsyncSupported(true);
filterRegistration.setEnabled(true);
filterRegistration.addUrlMappings("/druid/*");
filterRegistration.setInitParameters(druidStatParameters(druidStatConfig));
return filterRegistration;
}
示例4: dispatcherServletRegistration
import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
/**
* Register dispatcherServlet programmatically
*
* @return ServletRegistrationBean
*/
@Bean
public ServletRegistrationBean dispatcherServletRegistration() {
ServletRegistrationBean registration = new ServletRegistrationBean(
dispatcherServlet(), "/");
registration
.setName(DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME);
registration.setAsyncSupported(true);
registration.setEnabled(true);
registration.setLoadOnStartup(1);
return registration;
}