當前位置: 首頁>>代碼示例>>Java>>正文


Java ServletRegistrationBean.addInitParameter方法代碼示例

本文整理匯總了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;
}
 
開發者ID:xiaowing,項目名稱:various_demos,代碼行數:15,代碼來源:ServletConfig.java

示例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;
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:15,代碼來源:SampleAtmosphereApplication.java

示例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());

}
 
開發者ID:eclipse,項目名稱:hawkbit,代碼行數:10,代碼來源:AsyncVaadinServletConfiguration.java

示例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;
}
 
開發者ID:Manfred73,項目名稱:graphite-monitor-example,代碼行數:8,代碼來源:WebConfiguration.java

示例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;
}
 
開發者ID:Derek-Ashmore,項目名稱:moneta,代碼行數:10,代碼來源:MonetaSpringBootApplication.java

示例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;
}
 
開發者ID:angel-git,項目名稱:deep,代碼行數:9,代碼來源:Application.java

示例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;
}
 
開發者ID:angel-git,項目名稱:deep,代碼行數:9,代碼來源:Application.java

示例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;
}
 
開發者ID:PayU-Tech,項目名稱:Ratel,代碼行數:8,代碼來源:DiscoveryServerMain.java

示例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;
}
 
開發者ID:alexandruatomei9,項目名稱:GetSocial,代碼行數:7,代碼來源:Application.java

示例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;
}
 
開發者ID:joshlong,項目名稱:boot-examples,代碼行數:7,代碼來源:Application.java

示例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;
}
 
開發者ID:mraible,項目名稱:boot-makeover,代碼行數:7,代碼來源:ApplicationInitializer.java

示例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;

}
 
開發者ID:shinyjunjun,項目名稱:myblog,代碼行數:42,代碼來源:DruidConfiguration.java


注:本文中的org.springframework.boot.context.embedded.ServletRegistrationBean.addInitParameter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。