- Add session browser capabilities in the manager. Let me know if it creates problems...
authorremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 16 Apr 2007 23:30:03 +0000 (23:30 +0000)
committerremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 16 Apr 2007 23:30:03 +0000 (23:30 +0000)
  but please double check if you can).
- Submitted by Cédrik Lime.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@529442 13f79535-47bb-0310-9956-ffa450edef68

webapps/manager/sessionDetail.jsp [new file with mode: 0644]

diff --git a/webapps/manager/sessionDetail.jsp b/webapps/manager/sessionDetail.jsp
new file mode 100644 (file)
index 0000000..8c4844b
--- /dev/null
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>\r
+<%@page session="false" contentType="text/html; charset=ISO-8859-1" %>\r
+<%@page import="java.util.Enumeration" %>\r
+<%@page import="javax.servlet.http.HttpSession" %>\r
+<%@page import="org.apache.catalina.Session" %>\r
+<%@page import="org.apache.catalina.manager.JspHelper" %>\r
+<!DOCTYPE html \r
+     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\r
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<%--!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"--%>\r
+\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
+<% String path = (String) request.getAttribute("path");\r
+   Session currentSession = (Session)request.getAttribute("currentSession");\r
+   HttpSession currentHttpSession = currentSession.getSession();\r
+   String currentSessionId = currentSession.getId();\r
+   String submitUrl = ((HttpServletRequest)pageContext.getRequest()).getRequestURL().toString();\r
+%>\r
+<head>\r
+    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>\r
+       <meta http-equiv="pragma" content="no-cache"/><!-- HTTP 1.0 -->\r
+       <meta http-equiv="cache-control" content="no-cache,must-revalidate"/><!-- HTTP 1.1 -->\r
+       <meta http-equiv="expires" content="0"/><!-- 0 is an invalid value and should be treated as 'now' -->\r
+       <meta http-equiv="content-language" content="en"/>\r
+       <meta name="author" content="Cedrik LIME"/>\r
+       <meta name="copyright" content="copyright 2005-2007 the Apache Software Foundation"/>\r
+       <meta name="robots" content="noindex,nofollow,noarchive"/>\r
+       <title>Sessions Administration: details for <%= currentSessionId %></title>\r
+</head>\r
+<body>\r
+<h1>Details for Session <%= JspHelper.escapeXml(currentSessionId) %></h1>\r
+\r
+<table style="text-align: left;" border="0">
+  <tr>
+    <th>Session Id</th>
+    <td><%= currentSessionId %></td>
+  </tr>
+  <tr>\r
+    <th>Guessed Locale</th>\r
+    <td><%= JspHelper.guessDisplayLocaleFromSession(currentSession) %></td>\r
+  </tr>\r
+  <tr>\r
+    <th>Guessed User</th>\r
+    <td><%= JspHelper.guessDisplayUserFromSession(currentSession) %></td>\r
+  </tr>\r
+  <tr>\r
+    <th>Creation Time</th>\r
+    <td><%= JspHelper.getDisplayCreationTimeForSession(currentSession) %></td>\r
+  </tr>\r
+  <tr>\r
+    <th>Last Accessed Time</th>\r
+    <td><%= JspHelper.getDisplayLastAccessedTimeForSession(currentSession) %></td>\r
+  </tr>\r
+  <tr>\r
+    <th>Session Max Inactive Interval</th>\r
+    <td><%= JspHelper.secondsToTimeString(currentSession.getMaxInactiveInterval()) %></td>\r
+  </tr>\r
+  <tr>\r
+    <th>Used Time</th>\r
+    <td><%= JspHelper.getDisplayUsedTimeForSession(currentSession) %></td>\r
+  </tr>\r
+  <tr>\r
+    <th>Inactive Time</th>\r
+    <td><%= JspHelper.getDisplayInactiveTimeForSession(currentSession) %></td>\r
+  </tr>\r
+  <tr>\r
+    <th>TTL</th>\r
+    <td><%= JspHelper.getDisplayTTLForSession(currentSession) %></td>\r
+  </tr>\r
+</table>
+\r
+<p style="text-align: center;"><button type="button" onclick="window.location.reload()">Refresh</button></p>\r
+\r
+<div class="error"><%= JspHelper.escapeXml(request.getAttribute("error")) %></div>\r
+<div class="message"><%= JspHelper.escapeXml(request.getAttribute("message")) %></div>\r
+\r
+<table style="text-align: left;" border="1" cellpadding="2" cellspacing="2">\r
+<% int nAttributes = 0;\r
+   Enumeration attributeNamesEnumeration = currentHttpSession.getAttributeNames();\r
+   while (attributeNamesEnumeration.hasMoreElements()) {\r
+          attributeNamesEnumeration.nextElement();\r
+          ++nAttributes;\r
+   }\r
+%>\r
+       <caption style="font-variant: small-caps;"><%= JspHelper.formatNumber(nAttributes) %> attributes</caption>\r
+       <thead>\r
+               <tr>\r
+                       <th>Remove Attribute</th>\r
+                       <th>Attribute name</th>\r
+                       <th>Attribute value</th>\r
+               </tr>\r
+       </thead>\r
+       <%--tfoot>\r
+               <tr>\r
+                       <td colspan="3" style="text-align: center;">\r
+                               TODO: set Max Inactive Interval on sessions\r
+                       </td>\r
+               </tr>\r
+       </tfoot--%>\r
+       <tbody>\r
+<% attributeNamesEnumeration = currentHttpSession.getAttributeNames();\r
+   while (attributeNamesEnumeration.hasMoreElements()) {\r
+       String attributeName = (String) attributeNamesEnumeration.nextElement();\r
+%>\r
+               <tr>\r
+                       <td align="center"><form action="<%= submitUrl %>"><div><input type="hidden" name="path" value="<%= path %>" /><input type="hidden" name="action" value="removeSessionAttribute" /><input type="hidden" name="sessionId" value="<%= currentSessionId %>" /><input type="hidden" name="attributeName" value="<%= attributeName %>" /><input type="submit" value="Remove" /></div></form></td>\r
+                       <td><%= JspHelper.escapeXml(attributeName) %></td>\r
+                       <td><% Object attributeValue = currentHttpSession.getAttribute(attributeName); %><span title="<%= attributeValue == null ? "" : attributeValue.getClass().toString() %>"><%= JspHelper.escapeXml(attributeValue) %></span></td>\r
+               </tr>\r
+<% } // end while %>\r
+       </tbody>\r
+</table>\r
+\r
+<p style="text-align: center;"><button type="button" onclick="window.close()">Close window</button></p>\r
+\r
+<%--div style="display: none;">\r
+<p>\r
+       <a href="http://validator.w3.org/check?uri=referer"><img\r
+               src="http://www.w3.org/Icons/valid-html401"\r
+               alt="Valid HTML 4.01!" height="31" width="88"></a>\r
+       <a href="http://validator.w3.org/check?uri=referer"><img\r
+               src="http://www.w3.org/Icons/valid-xhtml10"\r
+               alt="Valid XHTML 1.0!" height="31" width="88" /></a>\r
+       <a href="http://validator.w3.org/check?uri=referer"><img\r
+               src="http://www.w3.org/Icons/valid-xhtml11"\r
+               alt="Valid XHTML 1.1!" height="31" width="88" /></a>\r
+</p>\r
+</div--%>\r
+\r
+</body>\r
+</html>
\ No newline at end of file