| Hongqing Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
 | 
 | 2 | <%--
 | 
 | 3 |  Licensed to the Apache Software Foundation (ASF) under one or more
 | 
 | 4 |   contributor license agreements.  See the NOTICE file distributed with
 | 
 | 5 |   this work for additional information regarding copyright ownership.
 | 
 | 6 |   The ASF licenses this file to You under the Apache License, Version 2.0
 | 
 | 7 |   (the "License"); you may not use this file except in compliance with
 | 
 | 8 |   the License.  You may obtain a copy of the License at
 | 
 | 9 | 
 | 
 | 10 |       http://www.apache.org/licenses/LICENSE-2.0
 | 
 | 11 | 
 | 
 | 12 |   Unless required by applicable law or agreed to in writing, software
 | 
 | 13 |   distributed under the License is distributed on an "AS IS" BASIS,
 | 
 | 14 |   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
 | 15 |   See the License for the specific language governing permissions and
 | 
 | 16 |   limitations under the License.
 | 
 | 17 | --%>
 | 
 | 18 | <%@page session="false" contentType="text/html; charset=ISO-8859-1" %>
 | 
 | 19 | <%@page import="java.util.Enumeration" %>
 | 
 | 20 | <%@page import="javax.servlet.http.HttpSession" %>
 | 
 | 21 | <%@page import="org.apache.catalina.Session" %>
 | 
 | 22 | <%@page import="org.apache.catalina.manager.JspHelper" %>
 | 
 | 23 | <!DOCTYPE html 
 | 
 | 24 |      PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 | 
 | 25 |      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 | 
 | 26 | <%--!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
 | 
 | 27 |  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"--%>
 | 
 | 28 | 
 | 
 | 29 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 | 
 | 30 | <% String path = (String) request.getAttribute("path");
 | 
 | 31 |    Session currentSession = (Session)request.getAttribute("currentSession");
 | 
 | 32 |    HttpSession currentHttpSession = currentSession.getSession();
 | 
 | 33 |    String currentSessionId = JspHelper.escapeXml(currentSession.getId());
 | 
 | 34 |    String submitUrl = JspHelper.escapeXml(response.encodeURL(
 | 
 | 35 |            ((HttpServletRequest) pageContext.getRequest()).getRequestURI() +
 | 
 | 36 |            "?path=" + path));
 | 
 | 37 | %>
 | 
 | 38 | <head>
 | 
 | 39 |     <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
 | 
 | 40 |     <meta http-equiv="pragma" content="no-cache"/><!-- HTTP 1.0 -->
 | 
 | 41 |     <meta http-equiv="cache-control" content="no-cache,must-revalidate"/><!-- HTTP 1.1 -->
 | 
 | 42 |     <meta http-equiv="expires" content="0"/><!-- 0 is an invalid value and should be treated as 'now' -->
 | 
 | 43 |     <meta http-equiv="content-language" content="en"/>
 | 
 | 44 |     <meta name="author" content="Cedrik LIME"/>
 | 
 | 45 |     <meta name="copyright" content="copyright 2005-2014 the Apache Software Foundation"/>
 | 
 | 46 |     <meta name="robots" content="noindex,nofollow,noarchive"/>
 | 
 | 47 |     <title>Sessions Administration: details for <%= currentSessionId %></title>
 | 
 | 48 | </head>
 | 
 | 49 | <body>
 | 
 | 50 | <h1>Details for Session <%= currentSessionId %></h1>
 | 
 | 51 | 
 | 
 | 52 | <table style="text-align: left;" border="0">
 | 
 | 53 |   <tr>
 | 
 | 54 |     <th>Session Id</th>
 | 
 | 55 |     <td><%= currentSessionId %></td>
 | 
 | 56 |   </tr>
 | 
 | 57 |   <tr>
 | 
 | 58 |     <th>Guessed Locale</th>
 | 
 | 59 |     <td><%= JspHelper.guessDisplayLocaleFromSession(currentSession) %></td>
 | 
 | 60 |   </tr>
 | 
 | 61 |   <tr>
 | 
 | 62 |     <th>Guessed User</th>
 | 
 | 63 |     <td><%= JspHelper.guessDisplayUserFromSession(currentSession) %></td>
 | 
 | 64 |   </tr>
 | 
 | 65 |   <tr>
 | 
 | 66 |     <th>Creation Time</th>
 | 
 | 67 |     <td><%= JspHelper.getDisplayCreationTimeForSession(currentSession) %></td>
 | 
 | 68 |   </tr>
 | 
 | 69 |   <tr>
 | 
 | 70 |     <th>Last Accessed Time</th>
 | 
 | 71 |     <td><%= JspHelper.getDisplayLastAccessedTimeForSession(currentSession) %></td>
 | 
 | 72 |   </tr>
 | 
 | 73 |   <tr>
 | 
 | 74 |     <th>Session Max Inactive Interval</th>
 | 
 | 75 |     <td><%= JspHelper.secondsToTimeString(currentSession.getMaxInactiveInterval()) %></td>
 | 
 | 76 |   </tr>
 | 
 | 77 |   <tr>
 | 
 | 78 |     <th>Used Time</th>
 | 
 | 79 |     <td><%= JspHelper.getDisplayUsedTimeForSession(currentSession) %></td>
 | 
 | 80 |   </tr>
 | 
 | 81 |   <tr>
 | 
 | 82 |     <th>Inactive Time</th>
 | 
 | 83 |     <td><%= JspHelper.getDisplayInactiveTimeForSession(currentSession) %></td>
 | 
 | 84 |   </tr>
 | 
 | 85 |   <tr>
 | 
 | 86 |     <th>TTL</th>
 | 
 | 87 |     <td><%= JspHelper.getDisplayTTLForSession(currentSession) %></td>
 | 
 | 88 |   </tr>
 | 
 | 89 | </table>
 | 
 | 90 | 
 | 
 | 91 | <form method="post" action="<%= submitUrl %>">
 | 
 | 92 |   <div>
 | 
 | 93 |     <input type="hidden" name="sessionId" value="<%= currentSessionId %>" />
 | 
 | 94 |     <input type="hidden" name="action" value="sessionDetail" />
 | 
 | 95 |     <input type="submit" value="Refresh" />
 | 
 | 96 |   </div>
 | 
 | 97 | </form>
 | 
 | 98 | 
 | 
 | 99 | <div class="error"><%= JspHelper.escapeXml(request.getAttribute("error")) %></div>
 | 
 | 100 | <div class="message"><%= JspHelper.escapeXml(request.getAttribute("message")) %></div>
 | 
 | 101 | 
 | 
 | 102 | <table style="text-align: left;" border="1" cellpadding="2" cellspacing="2">
 | 
 | 103 | <% int nAttributes = 0;
 | 
 | 104 |    Enumeration attributeNamesEnumeration = currentHttpSession.getAttributeNames();
 | 
 | 105 |    while (attributeNamesEnumeration.hasMoreElements()) {
 | 
 | 106 |        attributeNamesEnumeration.nextElement();
 | 
 | 107 |        ++nAttributes;
 | 
 | 108 |    }
 | 
 | 109 | %>
 | 
 | 110 |     <caption style="font-variant: small-caps;"><%= JspHelper.formatNumber(nAttributes) %> attributes</caption>
 | 
 | 111 |     <thead>
 | 
 | 112 |         <tr>
 | 
 | 113 |             <th>Remove Attribute</th>
 | 
 | 114 |             <th>Attribute name</th>
 | 
 | 115 |             <th>Attribute value</th>
 | 
 | 116 |         </tr>
 | 
 | 117 |     </thead>
 | 
 | 118 |     <%--tfoot>
 | 
 | 119 |         <tr>
 | 
 | 120 |             <td colspan="3" style="text-align: center;">
 | 
 | 121 |                 TODO: set Max Inactive Interval on sessions
 | 
 | 122 |             </td>
 | 
 | 123 |         </tr>
 | 
 | 124 |     </tfoot--%>
 | 
 | 125 |     <tbody>
 | 
 | 126 | <% attributeNamesEnumeration = currentHttpSession.getAttributeNames();
 | 
 | 127 |    while (attributeNamesEnumeration.hasMoreElements()) {
 | 
 | 128 |        String attributeName = (String) attributeNamesEnumeration.nextElement();
 | 
 | 129 | %>
 | 
 | 130 |         <tr>
 | 
 | 131 |             <td align="center">
 | 
 | 132 |                 <form method="post" action="<%= submitUrl %>">
 | 
 | 133 |                     <div>
 | 
 | 134 |                         <input type="hidden" name="action" value="removeSessionAttribute" />
 | 
 | 135 |                         <input type="hidden" name="sessionId" value="<%= currentSessionId %>" />
 | 
 | 136 |                         <input type="hidden" name="attributeName" value="<%= JspHelper.escapeXml(attributeName) %>" />
 | 
 | 137 |                         <input type="submit" value="Remove" />
 | 
 | 138 |                     </div>
 | 
 | 139 |                 </form>
 | 
 | 140 |             </td>
 | 
 | 141 |             <td><%= JspHelper.escapeXml(attributeName) %></td>
 | 
 | 142 |             <td><% Object attributeValue = currentHttpSession.getAttribute(attributeName); %><span title="<%= attributeValue == null ? "" : attributeValue.getClass().toString() %>"><%= JspHelper.escapeXml(attributeValue) %></span></td>
 | 
 | 143 |         </tr>
 | 
 | 144 | <% } // end while %>
 | 
 | 145 |     </tbody>
 | 
 | 146 | </table>
 | 
 | 147 | 
 | 
 | 148 | <form method="post" action="<%=submitUrl%>">
 | 
 | 149 |   <p style="text-align: center;">
 | 
 | 150 |     <input type="submit" value="Return to session list" />
 | 
 | 151 |   </p>
 | 
 | 152 | </form>
 | 
 | 153 | 
 | 
 | 154 | <%--div style="display: none;">
 | 
 | 155 | <p>
 | 
 | 156 |     <a href="http://validator.w3.org/check?uri=referer"><img
 | 
 | 157 |         src="http://www.w3.org/Icons/valid-html401"
 | 
 | 158 |         alt="Valid HTML 4.01!" height="31" width="88"></a>
 | 
 | 159 |     <a href="http://validator.w3.org/check?uri=referer"><img
 | 
 | 160 |         src="http://www.w3.org/Icons/valid-xhtml10"
 | 
 | 161 |         alt="Valid XHTML 1.0!" height="31" width="88" /></a>
 | 
 | 162 |     <a href="http://validator.w3.org/check?uri=referer"><img
 | 
 | 163 |         src="http://www.w3.org/Icons/valid-xhtml11"
 | 
 | 164 |         alt="Valid XHTML 1.1!" height="31" width="88" /></a>
 | 
 | 165 | </p>
 | 
 | 166 | </div--%>
 | 
 | 167 | 
 | 
 | 168 | </body>
 | 
 | 169 | </html>
 |