本文整理汇总了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;
}