From: remm Date: Mon, 16 Apr 2007 23:30:03 +0000 (+0000) Subject: - Add session browser capabilities in the manager. Let me know if it creates problems... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=65dfb59235504ce9bc7fcd48b9a7bd32c3406518;p=tomcat7.0 - Add session browser capabilities in the manager. Let me know if it creates problems (I checked XSS to some extent to, 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 --- diff --git a/webapps/manager/sessionDetail.jsp b/webapps/manager/sessionDetail.jsp new file mode 100644 index 000000000..8c4844b63 --- /dev/null +++ b/webapps/manager/sessionDetail.jsp @@ -0,0 +1,132 @@ + +<%@page session="false" contentType="text/html; charset=ISO-8859-1" %> +<%@page import="java.util.Enumeration" %> +<%@page import="javax.servlet.http.HttpSession" %> +<%@page import="org.apache.catalina.Session" %> +<%@page import="org.apache.catalina.manager.JspHelper" %> + +<%--!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" + "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"--%> + + +<% String path = (String) request.getAttribute("path"); + Session currentSession = (Session)request.getAttribute("currentSession"); + HttpSession currentHttpSession = currentSession.getSession(); + String currentSessionId = currentSession.getId(); + String submitUrl = ((HttpServletRequest)pageContext.getRequest()).getRequestURL().toString(); +%> + + + + + + + + + + Sessions Administration: details for <%= currentSessionId %> + + +

Details for Session <%= JspHelper.escapeXml(currentSessionId) %>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Session Id<%= currentSessionId %>
Guessed Locale<%= JspHelper.guessDisplayLocaleFromSession(currentSession) %>
Guessed User<%= JspHelper.guessDisplayUserFromSession(currentSession) %>
Creation Time<%= JspHelper.getDisplayCreationTimeForSession(currentSession) %>
Last Accessed Time<%= JspHelper.getDisplayLastAccessedTimeForSession(currentSession) %>
Session Max Inactive Interval<%= JspHelper.secondsToTimeString(currentSession.getMaxInactiveInterval()) %>
Used Time<%= JspHelper.getDisplayUsedTimeForSession(currentSession) %>
Inactive Time<%= JspHelper.getDisplayInactiveTimeForSession(currentSession) %>
TTL<%= JspHelper.getDisplayTTLForSession(currentSession) %>
+ +

+ +
<%= JspHelper.escapeXml(request.getAttribute("error")) %>
+
<%= JspHelper.escapeXml(request.getAttribute("message")) %>
+ + +<% int nAttributes = 0; + Enumeration attributeNamesEnumeration = currentHttpSession.getAttributeNames(); + while (attributeNamesEnumeration.hasMoreElements()) { + attributeNamesEnumeration.nextElement(); + ++nAttributes; + } +%> + + + + + + + + + <%--tfoot> + + + + + +<% attributeNamesEnumeration = currentHttpSession.getAttributeNames(); + while (attributeNamesEnumeration.hasMoreElements()) { + String attributeName = (String) attributeNamesEnumeration.nextElement(); +%> + + + + + +<% } // end while %> + +
<%= JspHelper.formatNumber(nAttributes) %> attributes
Remove AttributeAttribute nameAttribute value
+ TODO: set Max Inactive Interval on sessions +
<%= JspHelper.escapeXml(attributeName) %><% Object attributeValue = currentHttpSession.getAttribute(attributeName); %>"><%= JspHelper.escapeXml(attributeValue) %>
+ +

+ +<%--div style="display: none;"> +

+ Valid HTML 4.01! + Valid XHTML 1.0! + Valid XHTML 1.1! +

+ + + + \ No newline at end of file