本文整理匯總了Java中org.springframework.boot.context.embedded.ServletRegistrationBean.addInitParameter方法的典型用法代碼示例。如果您正苦於以下問題:Java ServletRegistrationBean.addInitParameter方法的具體用法?Java ServletRegistrationBean.addInitParameter怎麽用?Java ServletRegistrationBean.addInitParameter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.boot.context.embedded.ServletRegistrationBean
的用法示例。
在下文中一共展示了ServletRegistrationBean.addInitParameter方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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;
}
示例2: atmosphereServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean atmosphereServlet() {
// Dispatcher servlet is mapped to '/home' to allow the AtmosphereServlet
// to be mapped to '/chat'
ServletRegistrationBean registration = new ServletRegistrationBean(
new AtmosphereServlet(), "/chat/*");
registration.addInitParameter("org.atmosphere.cpr.packages", "sample");
registration.addInitParameter("org.atmosphere.interceptor.HeartbeatInterceptor"
+ ".clientHeartbeatFrequencyInSeconds", "10");
registration.setLoadOnStartup(0);
// Need to occur before the EmbeddedAtmosphereInitializer
registration.setOrder(Ordered.HIGHEST_PRECEDENCE);
return registration;
}
示例3: addInitParameters
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Override
protected void addInitParameters(final ServletRegistrationBean servletRegistrationBean) {
super.addInitParameters(servletRegistrationBean);
servletRegistrationBean.addInitParameter(ApplicationConfig.JSR356_MAPPING_PATH, "/UI");
servletRegistrationBean.addInitParameter(ApplicationConfig.ATMOSPHERE_INTERCEPTORS,
SpringSecurityAtmosphereInterceptor.class.getName());
}
示例4: h2servletRegistration
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
ServletRegistrationBean h2servletRegistration() {
ServletRegistrationBean registration = new ServletRegistrationBean(new WebServlet());
registration.addUrlMappings("/console/*");
registration.addInitParameter("webAllowOthers", "true");
return registration;
}
示例5: monetaServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean monetaServlet() {
ServletRegistrationBean registration =
new ServletRegistrationBean(new MonetaServlet(),
"/moneta/topic/*");
registration.addInitParameter(
MonetaServlet.CONFIG_IGNORED_CONTEXT_PATH_NODES, "moneta,topic");
return registration;
}
示例6: servletRegistrationLessBean
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean servletRegistrationLessBean(){
ServletRegistrationBean registrationBean = new ServletRegistrationBean(new LessServlet(), "*.less");
registrationBean.setLoadOnStartup(1);
registrationBean.setName("LessServlet");
registrationBean.addInitParameter("cache", lessCached);
return registrationBean;
}
示例7: servletRegistrationCoffeeBean
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean servletRegistrationCoffeeBean(){
ServletRegistrationBean registrationBean = new ServletRegistrationBean(new CoffeeServlet(), "*.coffee");
registrationBean.setLoadOnStartup(1);
registrationBean.setName("CoffeeScript");
registrationBean.addInitParameter("cache",coffeeCached);
return registrationBean;
}
示例8: jerseyServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean jerseyServlet() throws ServletException {
ServletContainer servlet = new ServletContainer();
ServletRegistrationBean registration = new ServletRegistrationBean(servlet, "/server/*");
registration.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, JerseyConfig.class.getName());
return registration;
}
示例9: jerseyServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean jerseyServlet() {
ServletRegistrationBean registration = new ServletRegistrationBean(new ServletContainer(), "/rest/*");
registration.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, JerseyConfig.class.getName());
return registration;
}
示例10: jerseyServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean jerseyServlet() {
ServletRegistrationBean registration = new ServletRegistrationBean(new ServletContainer(), "/*");
registration.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, JaxRsApplication.class.getName());
return registration;
}
示例11: jerseyServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean jerseyServlet() {
ServletRegistrationBean registration = new ServletRegistrationBean(new ServletContainer(), "/v1.0/**");
registration.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, JerseyConfig.class.getName());
return registration;
}
示例12: DruidStatViewServle
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
/**
*
* 注冊一個StatViewServlet
*
* @return
*
*/
@Bean
public ServletRegistrationBean DruidStatViewServle() {
// org.springframework.boot.context.embedded.ServletRegistrationBean提供類的進行注冊.
ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(new StatViewServlet(),
"/druid/*");
// 添加初始化參數:initParams
// 白名單:
servletRegistrationBean.addInitParameter("allow", "127.0.0.1");
// IP黑名單 (存在共同時,deny優先於allow) : 如果滿足deny的話提示:Sorry, you are not
// permitted to view this page.
servletRegistrationBean.addInitParameter("deny", "192.168.1.73");
// 登錄查看信息的賬號密碼.
servletRegistrationBean.addInitParameter("loginUsername", "admin");
servletRegistrationBean.addInitParameter("loginPassword", "123456");
// 是否能夠重置數據.
servletRegistrationBean.addInitParameter("resetEnable", "true");
return servletRegistrationBean;
}