@Override public void preProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException { if (webApp.getSessionConfig().size() == 1) { SessionConfig sessionConfig = webApp.getSessionConfig().get(0); mergeSessionConfig(webApp, sessionConfig, context, ElementSource.WEB_XML); context.setAttribute("session-config", sessionConfig); } else if (webApp.getSessionConfig().size() > 1) { throw new DeploymentException(WebDeploymentMessageUtils.createMultipleConfigurationWebAppErrorMessage("session-config")); } }
private SessionConfig getSessionConfig(WebApp webApp, MergeContext context) { SessionConfig sessionConfig = (SessionConfig) context.getAttribute("session-config"); if (sessionConfig == null) { sessionConfig = new SessionConfig(); webApp.getSessionConfig().add(sessionConfig); context.setAttribute("session-config", sessionConfig); } return sessionConfig; }
private static void checkMultiplicities(WebApp webApp) throws DeploymentException { if (webApp.getSessionConfig().size() > 1) { throw new DeploymentException(WebDeploymentMessageUtils.createMultipleConfigurationWebAppErrorMessage("session-config")); } if (webApp.getJspConfig().size() > 1) { throw new DeploymentException(WebDeploymentMessageUtils.createMultipleConfigurationWebAppErrorMessage("jsp-config")); } if (webApp.getLoginConfig().size() > 1) { throw new DeploymentException(WebDeploymentMessageUtils.createMultipleConfigurationWebAppErrorMessage("login-config")); } }
if (webModule.getWebApp() != null && webModule.getWebApp().getSessionConfig() != null) { for (final SessionConfig sessionConfig : webModule.getWebApp().getSessionConfig()) { if (sessionConfig.getSessionTimeout() != null) { webAppInfo.sessionTimeout = sessionConfig.getSessionTimeout();
for (SessionConfig sessionConfig: webApp.getSessionConfig()) { SessionConfigInfo sessionConfigInfo = new SessionConfigInfo(); sessionConfigInfo.sessionTimeoutMinutes = sessionConfig.getSessionTimeout() != null? sessionConfig.getSessionTimeout(): null;
List<SessionConfig> sessionConfigs = webApp.getSessionConfig(); if (sessionConfigs.size() > 1) { throw new DeploymentException("Web app " + webApp.getDisplayName() + " cannot have more than one sesion-config element. Currently has " + sessionConfigs.size() + " session-config elements.");