升级Tomcat版本 apache-tomcat-7.0.77
diff --git a/tomcat-cas/webapps/manager/WEB-INF/jsp/sessionDetail.jsp b/tomcat-cas/webapps/manager/WEB-INF/jsp/sessionDetail.jsp
index 40e8979..0d903e6 100644
--- a/tomcat-cas/webapps/manager/WEB-INF/jsp/sessionDetail.jsp
+++ b/tomcat-cas/webapps/manager/WEB-INF/jsp/sessionDetail.jsp
@@ -20,7 +20,8 @@
<%@page import="javax.servlet.http.HttpSession" %>
<%@page import="org.apache.catalina.Session" %>
<%@page import="org.apache.catalina.manager.JspHelper" %>
-<!DOCTYPE html
+<%@page import="org.apache.catalina.util.ContextName" %>
+<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%--!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
@@ -28,12 +29,20 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<% String path = (String) request.getAttribute("path");
+ String version = (String) request.getAttribute("version");
+ ContextName cn = new ContextName(path, version);
Session currentSession = (Session)request.getAttribute("currentSession");
- HttpSession currentHttpSession = currentSession.getSession();
- String currentSessionId = JspHelper.escapeXml(currentSession.getId());
+ String currentSessionId = null;
+ HttpSession currentHttpSession = null;
+ if (currentSession != null) {
+ currentHttpSession = currentSession.getSession();
+ currentSessionId = JspHelper.escapeXml(currentSession.getId());
+ } else {
+ currentSessionId = "Session invalidated";
+ }
String submitUrl = JspHelper.escapeXml(response.encodeURL(
((HttpServletRequest) pageContext.getRequest()).getRequestURI() +
- "?path=" + path));
+ "?path=" + path + "&version=" + version));
%>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
@@ -42,108 +51,127 @@
<meta http-equiv="expires" content="0"/><!-- 0 is an invalid value and should be treated as 'now' -->
<meta http-equiv="content-language" content="en"/>
<meta name="author" content="Cedrik LIME"/>
- <meta name="copyright" content="copyright 2005-2014 the Apache Software Foundation"/>
+ <meta name="copyright" content="copyright 2005-2017 the Apache Software Foundation"/>
<meta name="robots" content="noindex,nofollow,noarchive"/>
<title>Sessions Administration: details for <%= currentSessionId %></title>
</head>
<body>
-<h1>Details for Session <%= currentSessionId %></h1>
+<% if (currentHttpSession == null) { %>
+ <h1><%=currentSessionId%></h1>
+<% } else { %>
+ <h1>Details for Session <%= currentSessionId %></h1>
-<table style="text-align: left;" border="0">
- <tr>
- <th>Session Id</th>
- <td><%= currentSessionId %></td>
- </tr>
- <tr>
- <th>Guessed Locale</th>
- <td><%= JspHelper.guessDisplayLocaleFromSession(currentSession) %></td>
- </tr>
- <tr>
- <th>Guessed User</th>
- <td><%= JspHelper.guessDisplayUserFromSession(currentSession) %></td>
- </tr>
- <tr>
- <th>Creation Time</th>
- <td><%= JspHelper.getDisplayCreationTimeForSession(currentSession) %></td>
- </tr>
- <tr>
- <th>Last Accessed Time</th>
- <td><%= JspHelper.getDisplayLastAccessedTimeForSession(currentSession) %></td>
- </tr>
- <tr>
- <th>Session Max Inactive Interval</th>
- <td><%= JspHelper.secondsToTimeString(currentSession.getMaxInactiveInterval()) %></td>
- </tr>
- <tr>
- <th>Used Time</th>
- <td><%= JspHelper.getDisplayUsedTimeForSession(currentSession) %></td>
- </tr>
- <tr>
- <th>Inactive Time</th>
- <td><%= JspHelper.getDisplayInactiveTimeForSession(currentSession) %></td>
- </tr>
- <tr>
- <th>TTL</th>
- <td><%= JspHelper.getDisplayTTLForSession(currentSession) %></td>
- </tr>
-</table>
+ <table style="text-align: left;" border="0">
+ <tr>
+ <th>Session Id</th>
+ <td><%= currentSessionId %></td>
+ </tr>
+ <tr>
+ <th>Guessed Locale</th>
+ <td><%= JspHelper.guessDisplayLocaleFromSession(currentSession) %></td>
+ </tr>
+ <tr>
+ <th>Guessed User</th>
+ <td><%= JspHelper.guessDisplayUserFromSession(currentSession) %></td>
+ </tr>
+ <tr>
+ <th>Creation Time</th>
+ <td><%= JspHelper.getDisplayCreationTimeForSession(currentSession) %></td>
+ </tr>
+ <tr>
+ <th>Last Accessed Time</th>
+ <td><%= JspHelper.getDisplayLastAccessedTimeForSession(currentSession) %></td>
+ </tr>
+ <tr>
+ <th>Session Max Inactive Interval</th>
+ <td><%= JspHelper.secondsToTimeString(currentSession.getMaxInactiveInterval()) %></td>
+ </tr>
+ <tr>
+ <th>Used Time</th>
+ <td><%= JspHelper.getDisplayUsedTimeForSession(currentSession) %></td>
+ </tr>
+ <tr>
+ <th>Inactive Time</th>
+ <td><%= JspHelper.getDisplayInactiveTimeForSession(currentSession) %></td>
+ </tr>
+ <tr>
+ <th>TTL</th>
+ <td><%= JspHelper.getDisplayTTLForSession(currentSession) %></td>
+ </tr>
+ </table>
-<form method="post" action="<%= submitUrl %>">
- <div>
- <input type="hidden" name="sessionId" value="<%= currentSessionId %>" />
- <input type="hidden" name="action" value="sessionDetail" />
- <input type="submit" value="Refresh" />
- </div>
-</form>
+ <form method="post" action="<%= submitUrl %>">
+ <div>
+ <input type="hidden" name="sessionId" value="<%= currentSessionId %>" />
+ <input type="hidden" name="action" value="sessionDetail" />
+ <%
+ if ("Primary".equals(request.getParameter("sessionType"))) {
+ %>
+ <input type="hidden" name="sessionType" value="Primary" />
+ <%
+ }
+ %> <input type="submit" value="Refresh" />
+ </div>
+ </form>
-<div class="error"><%= JspHelper.escapeXml(request.getAttribute("error")) %></div>
-<div class="message"><%= JspHelper.escapeXml(request.getAttribute("message")) %></div>
+ <div class="error"><%= JspHelper.escapeXml(request.getAttribute("error")) %></div>
+ <div class="message"><%= JspHelper.escapeXml(request.getAttribute("message")) %></div>
-<table style="text-align: left;" border="1" cellpadding="2" cellspacing="2">
-<% int nAttributes = 0;
- Enumeration attributeNamesEnumeration = currentHttpSession.getAttributeNames();
- while (attributeNamesEnumeration.hasMoreElements()) {
- attributeNamesEnumeration.nextElement();
- ++nAttributes;
- }
-%>
- <caption style="font-variant: small-caps;"><%= JspHelper.formatNumber(nAttributes) %> attributes</caption>
- <thead>
- <tr>
- <th>Remove Attribute</th>
- <th>Attribute name</th>
- <th>Attribute value</th>
- </tr>
- </thead>
- <%--tfoot>
- <tr>
- <td colspan="3" style="text-align: center;">
- TODO: set Max Inactive Interval on sessions
- </td>
- </tr>
- </tfoot--%>
- <tbody>
-<% attributeNamesEnumeration = currentHttpSession.getAttributeNames();
- while (attributeNamesEnumeration.hasMoreElements()) {
- String attributeName = (String) attributeNamesEnumeration.nextElement();
-%>
- <tr>
- <td align="center">
- <form method="post" action="<%= submitUrl %>">
- <div>
- <input type="hidden" name="action" value="removeSessionAttribute" />
- <input type="hidden" name="sessionId" value="<%= currentSessionId %>" />
- <input type="hidden" name="attributeName" value="<%= JspHelper.escapeXml(attributeName) %>" />
- <input type="submit" value="Remove" />
- </div>
- </form>
- </td>
- <td><%= JspHelper.escapeXml(attributeName) %></td>
- <td><% Object attributeValue = currentHttpSession.getAttribute(attributeName); %><span title="<%= attributeValue == null ? "" : attributeValue.getClass().toString() %>"><%= JspHelper.escapeXml(attributeValue) %></span></td>
- </tr>
-<% } // end while %>
- </tbody>
-</table>
+ <table style="text-align: left;" border="1" cellpadding="2" cellspacing="2">
+ <% int nAttributes = 0;
+ Enumeration attributeNamesEnumeration = currentHttpSession.getAttributeNames();
+ while (attributeNamesEnumeration.hasMoreElements()) {
+ attributeNamesEnumeration.nextElement();
+ ++nAttributes;
+ }
+ %>
+ <caption style="font-variant: small-caps;"><%= JspHelper.formatNumber(nAttributes) %> attributes</caption>
+ <thead>
+ <tr>
+ <th>Remove Attribute</th>
+ <th>Attribute name</th>
+ <th>Attribute value</th>
+ </tr>
+ </thead>
+ <%--tfoot>
+ <tr>
+ <td colspan="3" style="text-align: center;">
+ TODO: set Max Inactive Interval on sessions
+ </td>
+ </tr>
+ </tfoot--%>
+ <tbody>
+ <% attributeNamesEnumeration = currentHttpSession.getAttributeNames();
+ while (attributeNamesEnumeration.hasMoreElements()) {
+ String attributeName = (String) attributeNamesEnumeration.nextElement();
+ %>
+ <tr>
+ <td align="center">
+ <form method="post" action="<%= submitUrl %>">
+ <div>
+ <input type="hidden" name="action" value="removeSessionAttribute" />
+ <input type="hidden" name="sessionId" value="<%= currentSessionId %>" />
+ <input type="hidden" name="attributeName" value="<%= JspHelper.escapeXml(attributeName) %>" />
+ <%
+ if ("Primary".equals(request.getParameter("sessionType"))) {
+ %>
+ <input type="submit" value="Remove" />
+ <input type="hidden" name="sessionType" value="Primary" />
+ <%
+ } else {
+ out.print("Primary sessions only");
+ }
+ %>
+ </div>
+ </form>
+ </td>
+ <td><%= JspHelper.escapeXml(attributeName) %></td>
+ <td><% Object attributeValue = currentHttpSession.getAttribute(attributeName); %><span title="<%= attributeValue == null ? "" : attributeValue.getClass().toString() %>"><%= JspHelper.escapeXml(attributeValue) %></span></td>
+ </tr>
+ <% } // end while %>
+ </tbody>
+ </table>
+<% } // endif%>
<form method="post" action="<%=submitUrl%>">
<p style="text-align: center;">