本文整理匯總了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);
}
示例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
}
};
}
示例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);
}
示例4: customize
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; //導入方法依賴的package包/類
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
container.setSessionTimeout(30);
}
示例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);
}
示例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()));
}