本文整理匯總了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;
}