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


Java ConfigurableEmbeddedServletContainer.setContextPath方法代碼示例

本文整理匯總了Java中org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer.setContextPath方法的典型用法代碼示例。如果您正苦於以下問題:Java ConfigurableEmbeddedServletContainer.setContextPath方法的具體用法?Java ConfigurableEmbeddedServletContainer.setContextPath怎麽用?Java ConfigurableEmbeddedServletContainer.setContextPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer的用法示例。


在下文中一共展示了ConfigurableEmbeddedServletContainer.setContextPath方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //導入方法依賴的package包/類
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
	if (this.managementServerProperties == null) {
		this.managementServerProperties = BeanFactoryUtils
				.beanOfTypeIncludingAncestors(this.beanFactory,
						ManagementServerProperties.class);
		this.server = BeanFactoryUtils.beanOfTypeIncludingAncestors(
				this.beanFactory, ServerProperties.class);
	}
	// Customize as per the parent context first (so e.g. the access logs go to
	// the same place)
	this.server.customize(container);
	// Then reset the error pages
	container.setErrorPages(Collections.<ErrorPage>emptySet());
	// and the context path
	container.setContextPath("");
	// and add the management-specific bits
	container.setPort(this.managementServerProperties.getPort());
	if (this.managementServerProperties.getSsl() != null) {
		container.setSsl(this.managementServerProperties.getSsl());
	}
	container.setServerHeader(this.server.getServerHeader());
	container.setAddress(this.managementServerProperties.getAddress());
	container.addErrorPages(new ErrorPage(this.server.getError().getPath()));
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:26,代碼來源:EndpointWebMvcChildContextConfiguration.java

示例2: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //導入方法依賴的package包/類
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
	if (this.managementServerProperties == null) {
		this.managementServerProperties = BeanFactoryUtils
				.beanOfTypeIncludingAncestors(this.beanFactory,
						ManagementServerProperties.class);
		this.server = BeanFactoryUtils.beanOfTypeIncludingAncestors(
				this.beanFactory, ServerProperties.class);
	}
	// Customize as per the parent context first (so e.g. the access logs go to
	// the same place)
	this.server.customize(container);
	// Then reset the error pages
	container.setErrorPages(Collections.<ErrorPage>emptySet());
	// and the context path
	container.setContextPath("");
	// and add the management-specific bits
	container.setPort(this.managementServerProperties.getPort());
	container.setServerHeader(this.server.getServerHeader());
	container.setAddress(this.managementServerProperties.getAddress());
	container.addErrorPages(new ErrorPage(this.server.getError().getPath()));
}
 
開發者ID:philwebb,項目名稱:spring-boot-concourse,代碼行數:23,代碼來源:EndpointWebMvcChildContextConfiguration.java

示例3: embeddedServletContainerCustomizer

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //導入方法依賴的package包/類
@Bean
public EmbeddedServletContainerCustomizer embeddedServletContainerCustomizer() {
    return new EmbeddedServletContainerCustomizer() {

        @Override
        public void customize(ConfigurableEmbeddedServletContainer container) {

            System.err.println("Customizing embeddedServlet container ");
            container.setSessionTimeout(1, TimeUnit.SECONDS);
            container.setPort(8084);// on which port embedded tomcat should run
            container.setContextPath("/spring-web-practice");// This is to make in sync with direct TOMCAT deployment and embedded server deployment
        }
    };
}
 
開發者ID:tvajjala,項目名稱:interview-preparation,代碼行數:15,代碼來源:DispatchServletConfig.java

示例4: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //導入方法依賴的package包/類
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
	if (getPort() != null) {
		container.setPort(getPort());
	}
	if (getAddress() != null) {
		container.setAddress(getAddress());
	}
	if (getContextPath() != null) {
		container.setContextPath(getContextPath());
	}
	if (getDisplayName() != null) {
		container.setDisplayName(getDisplayName());
	}
	if (getSession().getTimeout() != null) {
		container.setSessionTimeout(getSession().getTimeout());
	}
	container.setPersistSession(getSession().isPersistent());
	container.setSessionStoreDir(getSession().getStoreDir());
	if (getSsl() != null) {
		container.setSsl(getSsl());
	}
	if (getJspServlet() != null) {
		container.setJspServlet(getJspServlet());
	}
	if (getCompression() != null) {
		container.setCompression(getCompression());
	}
	container.setServerHeader(getServerHeader());
	if (container instanceof TomcatEmbeddedServletContainerFactory) {
		getTomcat().customizeTomcat(this,
				(TomcatEmbeddedServletContainerFactory) container);
	}
	if (container instanceof JettyEmbeddedServletContainerFactory) {
		getJetty().customizeJetty(this,
				(JettyEmbeddedServletContainerFactory) container);
	}

	if (container instanceof UndertowEmbeddedServletContainerFactory) {
		getUndertow().customizeUndertow(this,
				(UndertowEmbeddedServletContainerFactory) container);
	}
	container.addInitializers(new SessionConfiguringInitializer(this.session));
	container.addInitializers(new InitParameterConfiguringServletContextInitializer(
			getContextParameters()));
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:47,代碼來源:ServerProperties.java

示例5: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //導入方法依賴的package包/類
@Override
public void customize(final ConfigurableEmbeddedServletContainer container) {
    container.setContextPath(FinerLeagueConfigurationConstants.ROOT_CONTEXT_PATH);
}
 
開發者ID:thefinerthingsclub,項目名稱:finerleague,代碼行數:5,代碼來源:CustomEmbeddedServletContainerCustomizer.java

示例6: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //導入方法依賴的package包/類
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
	if (getPort() != null) {
		container.setPort(getPort());
	}
	if (getAddress() != null) {
		container.setAddress(getAddress());
	}
	if (getContextPath() != null) {
		container.setContextPath(getContextPath());
	}
	if (getDisplayName() != null) {
		container.setDisplayName(getDisplayName());
	}
	if (getSession().getTimeout() != null) {
		container.setSessionTimeout(getSession().getTimeout());
	}
	container.setPersistSession(getSession().isPersistent());
	container.setSessionStoreDir(getSession().getStoreDir());
	if (getSsl() != null) {
		container.setSsl(getSsl());
	}
	if (getJspServlet() != null) {
		container.setJspServlet(getJspServlet());
	}
	if (getCompression() != null) {
		container.setCompression(getCompression());
	}
	if (container instanceof TomcatEmbeddedServletContainerFactory) {
		getTomcat().customizeTomcat(this,
				(TomcatEmbeddedServletContainerFactory) container);
	}
	if (container instanceof JettyEmbeddedServletContainerFactory) {
		getJetty().customizeJetty(this,
				(JettyEmbeddedServletContainerFactory) container);
	}

	if (container instanceof UndertowEmbeddedServletContainerFactory) {
		getUndertow().customizeUndertow(this,
				(UndertowEmbeddedServletContainerFactory) container);
	}
	container.addInitializers(new SessionConfiguringInitializer(this.session));
	container.addInitializers(new InitParameterConfiguringServletContextInitializer(
			getContextParameters()));
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:46,代碼來源:ServerProperties.java


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