Project: Tomcat
Bug 51156 "Expire sessions" button not visible for context configured in server.xml
Reported: 2011-05-06 00:30:54 | Status: resolved fixed

If app is configured in server.xml like this: {code} <Host name="www.myapp.pl" appBase="/usr/lib/tomcat/webapps" unpackWARs="false" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false" > <Context docBase="/var/www/myapp" path="" cacheMaxSize="5120" cacheTTL="60000" cachingAllowed="true" > </Context> <Context path="/manager" privileged="true" docBase="/usr/lib/tomcat/webapps/manager"> </Context> </Host> {code} In Tomcat Manager, on the application list, there is a button "Expire sessions" available only for "/manager" application. There is no button "Expire sessions" for "/" path. I think bug is in HTMLManagerServlet.java in this part: {code} if (context.getPath().equals(this.context.getPath())) { writer.print(MessageFormat.format( MANAGER_APP_ROW_BUTTON_SECTION, args)); } else if (context.getAvailable() && isDeployed) { writer.print(MessageFormat.format( STARTED_DEPLOYED_APPS_ROW_BUTTON_SECTION, args)); } else if (context.getAvailable() && !isDeployed) { writer.print(MessageFormat.format( STARTED_NONDEPLOYED_APPS_ROW_BUTTON_SECTION, args)); } else if (!context.getAvailable() && isDeployed) { writer.print(MessageFormat.format( STOPPED_DEPLOYED_APPS_ROW_BUTTON_SECTION, args)); } else { writer.print(MessageFormat.format( STOPPED_NONDEPLOYED_APPS_ROW_BUTTON_SECTION, args)); } {code}

Files changed in fix:
java/org/apache/catalina/manager/HTMLManagerServlet.java