本文整理匯總了Java中org.springframework.boot.context.embedded.ServletRegistrationBean類的典型用法代碼示例。如果您正苦於以下問題:Java ServletRegistrationBean類的具體用法?Java ServletRegistrationBean怎麽用?Java ServletRegistrationBean使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ServletRegistrationBean類屬於org.springframework.boot.context.embedded包,在下文中一共展示了ServletRegistrationBean類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getODataServletRegistrationBean
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入依賴的package包/類
@Bean
public ServletRegistrationBean getODataServletRegistrationBean() {
ServletRegistrationBean odataServletRegistrationBean = new ServletRegistrationBean(new CXFNonSpringJaxrsServlet(), "/odata.svc/*");
Map<String, String> initParameters = new HashMap<String, String>();
initParameters.put("javax.ws.rs.Application", "org.apache.olingo.odata2.core.rest.app.ODataApplication");
initParameters.put("org.apache.olingo.odata2.service.factory", "com.sap.mentors.lemonaid.odata.JPAServiceFactory");
odataServletRegistrationBean.setInitParameters(initParameters);
return odataServletRegistrationBean;
}
示例2: facesServletRegistraiton
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入依賴的package包/類
@Bean
public ServletRegistrationBean facesServletRegistraiton() {
ServletRegistrationBean registration = new ServletRegistrationBean(new javax.faces.webapp.FacesServlet(),
"*.xhtml");
registration.setName("Faces Servlet");
registration.setLoadOnStartup(1);
return registration;
}
示例3: facesServletRegistraiton
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入依賴的package包/類
@Bean
public ServletRegistrationBean facesServletRegistraiton() {
ServletRegistrationBean registration = new ServletRegistrationBean(new FacesServlet(), "*.xhtml");
registration.setName("Faces Servlet");
registration.setLoadOnStartup(1);
return registration;
}
示例4: getODataServletRegistrationBean
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入依賴的package包/類
@Bean
public ServletRegistrationBean getODataServletRegistrationBean() {
ServletRegistrationBean odataServletRegistrationBean = new ServletRegistrationBean(new CXFNonSpringJaxrsServlet(), "/odata.svc/*");
Map<String, String> initParameters = new HashMap<String, String>();
initParameters.put("javax.ws.rs.Application", "org.apache.olingo.odata2.core.rest.app.ODataApplication");
initParameters.put("org.apache.olingo.odata2.service.factory", "com.penninkhof.odata.utils.JPAServiceFactory");
odataServletRegistrationBean.setInitParameters(initParameters);
return odataServletRegistrationBean;
}
示例5: dispatcherServletRegistration
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入依賴的package包/類
@Bean(name = DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME)
public ServletRegistrationBean dispatcherServletRegistration() {
ServletRegistrationBean registration = new ServletRegistrationBean(
dispatcherServlet(), this.server.getServletMapping());
registration.setName(DEFAULT_DISPATCHER_SERVLET_BEAN_NAME);
if (this.multipartConfig != null) {
registration.setMultipartConfig(this.multipartConfig);
}
return registration;
}
示例6: servletRegistrationBean
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入依賴的package包/類
@Bean(name="springBootServletRegistrationBean")
public ServletRegistrationBean servletRegistrationBean() {
SpringVaadinServlet servlet = new SpringVaadinServlet() {
private static final long serialVersionUID = 1L;
@Override
public void servletInitialized() throws ServletException {
super.servletInitialized();
getService().addSessionInitListener(new TraderSessionInitListener());
}
};
return new ServletRegistrationBean(servlet, "/ui/*", "/VAADIN/*");
}
示例7: configServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入依賴的package包/類
@Bean(name = "configServlet")
public ServletRegistrationBean configServlet() {
DispatcherServlet dispatcherServlet = new DispatcherServlet();
AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
applicationContext.register(ConfigServletConfig.class);
dispatcherServlet.setApplicationContext(applicationContext);
ServletRegistrationBean registrationBean = new ServletRegistrationBean(dispatcherServlet, "/config/*");
registrationBean.setLoadOnStartup(1);
return registrationBean;
}
示例8: registerServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入依賴的package包/類
@Bean
public ServletRegistrationBean registerServlet(){
ServletRegistrationBean statViewServletRegistrationBean =
new ServletRegistrationBean(dispatchDruidServlet(), "/druid/*");
/*
* According to the definition of StatViewServlet, the white-list of druid StatViewServlet
* can be specifed with the format as "xxx.xxx.xxx.xxx/yyy.yyy.yyy.yyy" to limit the access to
* the StatViewServlet.
*/
statViewServletRegistrationBean.addInitParameter(StatViewServlet.PARAM_NAME_ALLOW, "127.0.0.1");
statViewServletRegistrationBean.addInitParameter(StatViewServlet.PARAM_NAME_USERNAME, "admin");
statViewServletRegistrationBean.addInitParameter(StatViewServlet.PARAM_NAME_PASSWORD, "password");
return statViewServletRegistrationBean;
}
示例9: messageDispatcherServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入依賴的package包/類
@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
servlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean(servlet, "/ws/*");
}
示例10: messageDispatcherServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入依賴的package包/類
@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
log.info("Registering message dispatcher servlet.");
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
servlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean(servlet, "/soap-api/*");
}
示例11: statViewServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入依賴的package包/類
@Bean
@Order
public ServletRegistrationBean statViewServlet() {
StatViewServlet servlet = new StatViewServlet();
ServletRegistrationBean bean = new ServletRegistrationBean(servlet, "/druid/*");
return bean;
}
示例12: facesServletRegistration
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入依賴的package包/類
@Bean
public ServletRegistrationBean facesServletRegistration() {
ServletRegistrationBean registration = new ServletRegistrationBean(
new FacesServlet(), "*.xhtml");
registration.setLoadOnStartup(1);
return registration;
}
示例13: doHandle
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入依賴的package包/類
@Override
public void doHandle(Map<String, Object> attributes, BeanDefinition beanDefinition,
BeanDefinitionRegistry registry) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(ServletRegistrationBean.class);
builder.addPropertyValue("asyncSupported", attributes.get("asyncSupported"));
builder.addPropertyValue("initParameters", extractInitParameters(attributes));
builder.addPropertyValue("loadOnStartup", attributes.get("loadOnStartup"));
String name = determineName(attributes, beanDefinition);
builder.addPropertyValue("name", name);
builder.addPropertyValue("servlet", beanDefinition);
builder.addPropertyValue("urlMappings", extractUrlPatterns("urlPatterns", attributes));
registry.registerBeanDefinition(name, builder.getBeanDefinition());
}
示例14: h2servletRegistration
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入依賴的package包/類
@Bean
ServletRegistrationBean h2servletRegistration()
{
ServletRegistrationBean registrationBean = new ServletRegistrationBean( new WebServlet());
registrationBean.addUrlMappings("/console/*");
return registrationBean;
}
示例15: facesServletRegistration
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入依賴的package包/類
@Bean
public ServletRegistrationBean facesServletRegistration() {
ServletRegistrationBean registration = new ServletRegistrationBean(
new FacesServlet(), "*.xhtml");
registration.setLoadOnStartup(1);
return registration;
}