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


Java ConfigurableEmbeddedServletContainer.setSessionTimeout方法代碼示例

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


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

示例1: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //導入方法依賴的package包/類
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    super.customize(container);

    container.addErrorPages(new ErrorPage(HttpStatus.UNAUTHORIZED,
            "/error/401"));
    container.addErrorPages(new ErrorPage(HttpStatus.FORBIDDEN,
            "/error/403"));
    container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND,
            "/error/404"));
    container.addErrorPages(new ErrorPage(HttpStatus.GONE,
            "/error/410"));
    container.addErrorPages(new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR,
            "/error"));

    container.setSessionTimeout(sessionTimeout, TimeUnit.MINUTES);
}
 
開發者ID:Evolveum,項目名稱:midpoint,代碼行數:18,代碼來源:MidPointSpringApplication.java

示例2: 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

示例3: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //導入方法依賴的package包/類
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    container.setPort(9090);
    container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND,"/404.html"));
    container.setSessionTimeout(10, TimeUnit.MINUTES);
}
 
開發者ID:shuaishuaila,項目名稱:java_springboot,代碼行數:7,代碼來源:CustomServletContainer.java

示例4: customize

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //導入方法依賴的package包/類
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    container.setSessionTimeout(30);
}
 
開發者ID:venus-boot,項目名稱:saluki,代碼行數:5,代碼來源:MonitorApplication.java

示例5: 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

示例6: customizer

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //導入方法依賴的package包/類
@Bean
public EmbeddedServletContainerCustomizer customizer() throws Exception {
    return (ConfigurableEmbeddedServletContainer container) -> container.setSessionTimeout(1 * 60 * 60);
}
 
開發者ID:Justice-love,項目名稱:stockAnalysis,代碼行數:5,代碼來源:ApplicationStart.java

示例7: 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.setSessionTimeout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。