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" %>
|
刘洪青 | 6266f99 | 2017-05-15 21:21:03 +0800 | [diff] [blame^] | 23 | <%@page import="org.apache.catalina.util.ContextName" %>
|
| 24 | <!DOCTYPE html
|
Hongqing Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame] | 25 | PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
| 26 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
| 27 | <%--!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
| 28 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"--%>
|
| 29 |
|
| 30 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
| 31 | <% String path = (String) request.getAttribute("path");
|
刘洪青 | 6266f99 | 2017-05-15 21:21:03 +0800 | [diff] [blame^] | 32 | String version = (String) request.getAttribute("version");
|
| 33 | ContextName cn = new ContextName(path, version);
|
Hongqing Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame] | 34 | Session currentSession = (Session)request.getAttribute("currentSession");
|
刘洪青 | 6266f99 | 2017-05-15 21:21:03 +0800 | [diff] [blame^] | 35 | String currentSessionId = null;
|
| 36 | HttpSession currentHttpSession = null;
|
| 37 | if (currentSession != null) {
|
| 38 | currentHttpSession = currentSession.getSession();
|
| 39 | currentSessionId = JspHelper.escapeXml(currentSession.getId());
|
| 40 | } else {
|
| 41 | currentSessionId = "Session invalidated";
|
| 42 | }
|
Hongqing Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame] | 43 | String submitUrl = JspHelper.escapeXml(response.encodeURL(
|
| 44 | ((HttpServletRequest) pageContext.getRequest()).getRequestURI() +
|
刘洪青 | 6266f99 | 2017-05-15 21:21:03 +0800 | [diff] [blame^] | 45 | "?path=" + path + "&version=" + version));
|
Hongqing Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame] | 46 | %>
|
| 47 | <head>
|
| 48 | <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
|
| 49 | <meta http-equiv="pragma" content="no-cache"/><!-- HTTP 1.0 -->
|
| 50 | <meta http-equiv="cache-control" content="no-cache,must-revalidate"/><!-- HTTP 1.1 -->
|
| 51 | <meta http-equiv="expires" content="0"/><!-- 0 is an invalid value and should be treated as 'now' -->
|
| 52 | <meta http-equiv="content-language" content="en"/>
|
| 53 | <meta name="author" content="Cedrik LIME"/>
|
刘洪青 | 6266f99 | 2017-05-15 21:21:03 +0800 | [diff] [blame^] | 54 | <meta name="copyright" content="copyright 2005-2017 the Apache Software Foundation"/>
|
Hongqing Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame] | 55 | <meta name="robots" content="noindex,nofollow,noarchive"/>
|
| 56 | <title>Sessions Administration: details for <%= currentSessionId %></title>
|
| 57 | </head>
|
| 58 | <body>
|
刘洪青 | 6266f99 | 2017-05-15 21:21:03 +0800 | [diff] [blame^] | 59 | <% if (currentHttpSession == null) { %>
|
| 60 | <h1><%=currentSessionId%></h1>
|
| 61 | <% } else { %>
|
| 62 | <h1>Details for Session <%= currentSessionId %></h1>
|
Hongqing Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame] | 63 |
|
刘洪青 | 6266f99 | 2017-05-15 21:21:03 +0800 | [diff] [blame^] | 64 | <table style="text-align: left;" border="0">
|
| 65 | <tr>
|
| 66 | <th>Session Id</th>
|
| 67 | <td><%= currentSessionId %></td>
|
| 68 | </tr>
|
| 69 | <tr>
|
| 70 | <th>Guessed Locale</th>
|
| 71 | <td><%= JspHelper.guessDisplayLocaleFromSession(currentSession) %></td>
|
| 72 | </tr>
|
| 73 | <tr>
|
| 74 | <th>Guessed User</th>
|
| 75 | <td><%= JspHelper.guessDisplayUserFromSession(currentSession) %></td>
|
| 76 | </tr>
|
| 77 | <tr>
|
| 78 | <th>Creation Time</th>
|
| 79 | <td><%= JspHelper.getDisplayCreationTimeForSession(currentSession) %></td>
|
| 80 | </tr>
|
| 81 | <tr>
|
| 82 | <th>Last Accessed Time</th>
|
| 83 | <td><%= JspHelper.getDisplayLastAccessedTimeForSession(currentSession) %></td>
|
| 84 | </tr>
|
| 85 | <tr>
|
| 86 | <th>Session Max Inactive Interval</th>
|
| 87 | <td><%= JspHelper.secondsToTimeString(currentSession.getMaxInactiveInterval()) %></td>
|
| 88 | </tr>
|
| 89 | <tr>
|
| 90 | <th>Used Time</th>
|
| 91 | <td><%= JspHelper.getDisplayUsedTimeForSession(currentSession) %></td>
|
| 92 | </tr>
|
| 93 | <tr>
|
| 94 | <th>Inactive Time</th>
|
| 95 | <td><%= JspHelper.getDisplayInactiveTimeForSession(currentSession) %></td>
|
| 96 | </tr>
|
| 97 | <tr>
|
| 98 | <th>TTL</th>
|
| 99 | <td><%= JspHelper.getDisplayTTLForSession(currentSession) %></td>
|
| 100 | </tr>
|
| 101 | </table>
|
Hongqing Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame] | 102 |
|
刘洪青 | 6266f99 | 2017-05-15 21:21:03 +0800 | [diff] [blame^] | 103 | <form method="post" action="<%= submitUrl %>">
|
| 104 | <div>
|
| 105 | <input type="hidden" name="sessionId" value="<%= currentSessionId %>" />
|
| 106 | <input type="hidden" name="action" value="sessionDetail" />
|
| 107 | <%
|
| 108 | if ("Primary".equals(request.getParameter("sessionType"))) {
|
| 109 | %>
|
| 110 | <input type="hidden" name="sessionType" value="Primary" />
|
| 111 | <%
|
| 112 | }
|
| 113 | %> <input type="submit" value="Refresh" />
|
| 114 | </div>
|
| 115 | </form>
|
Hongqing Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame] | 116 |
|
刘洪青 | 6266f99 | 2017-05-15 21:21:03 +0800 | [diff] [blame^] | 117 | <div class="error"><%= JspHelper.escapeXml(request.getAttribute("error")) %></div>
|
| 118 | <div class="message"><%= JspHelper.escapeXml(request.getAttribute("message")) %></div>
|
Hongqing Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame] | 119 |
|
刘洪青 | 6266f99 | 2017-05-15 21:21:03 +0800 | [diff] [blame^] | 120 | <table style="text-align: left;" border="1" cellpadding="2" cellspacing="2">
|
| 121 | <% int nAttributes = 0;
|
| 122 | Enumeration attributeNamesEnumeration = currentHttpSession.getAttributeNames();
|
| 123 | while (attributeNamesEnumeration.hasMoreElements()) {
|
| 124 | attributeNamesEnumeration.nextElement();
|
| 125 | ++nAttributes;
|
| 126 | }
|
| 127 | %>
|
| 128 | <caption style="font-variant: small-caps;"><%= JspHelper.formatNumber(nAttributes) %> attributes</caption>
|
| 129 | <thead>
|
| 130 | <tr>
|
| 131 | <th>Remove Attribute</th>
|
| 132 | <th>Attribute name</th>
|
| 133 | <th>Attribute value</th>
|
| 134 | </tr>
|
| 135 | </thead>
|
| 136 | <%--tfoot>
|
| 137 | <tr>
|
| 138 | <td colspan="3" style="text-align: center;">
|
| 139 | TODO: set Max Inactive Interval on sessions
|
| 140 | </td>
|
| 141 | </tr>
|
| 142 | </tfoot--%>
|
| 143 | <tbody>
|
| 144 | <% attributeNamesEnumeration = currentHttpSession.getAttributeNames();
|
| 145 | while (attributeNamesEnumeration.hasMoreElements()) {
|
| 146 | String attributeName = (String) attributeNamesEnumeration.nextElement();
|
| 147 | %>
|
| 148 | <tr>
|
| 149 | <td align="center">
|
| 150 | <form method="post" action="<%= submitUrl %>">
|
| 151 | <div>
|
| 152 | <input type="hidden" name="action" value="removeSessionAttribute" />
|
| 153 | <input type="hidden" name="sessionId" value="<%= currentSessionId %>" />
|
| 154 | <input type="hidden" name="attributeName" value="<%= JspHelper.escapeXml(attributeName) %>" />
|
| 155 | <%
|
| 156 | if ("Primary".equals(request.getParameter("sessionType"))) {
|
| 157 | %>
|
| 158 | <input type="submit" value="Remove" />
|
| 159 | <input type="hidden" name="sessionType" value="Primary" />
|
| 160 | <%
|
| 161 | } else {
|
| 162 | out.print("Primary sessions only");
|
| 163 | }
|
| 164 | %>
|
| 165 | </div>
|
| 166 | </form>
|
| 167 | </td>
|
| 168 | <td><%= JspHelper.escapeXml(attributeName) %></td>
|
| 169 | <td><% Object attributeValue = currentHttpSession.getAttribute(attributeName); %><span title="<%= attributeValue == null ? "" : attributeValue.getClass().toString() %>"><%= JspHelper.escapeXml(attributeValue) %></span></td>
|
| 170 | </tr>
|
| 171 | <% } // end while %>
|
| 172 | </tbody>
|
| 173 | </table>
|
| 174 | <% } // endif%>
|
Hongqing Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame] | 175 |
|
| 176 | <form method="post" action="<%=submitUrl%>">
|
| 177 | <p style="text-align: center;">
|
| 178 | <input type="submit" value="Return to session list" />
|
| 179 | </p>
|
| 180 | </form>
|
| 181 |
|
| 182 | <%--div style="display: none;">
|
| 183 | <p>
|
| 184 | <a href="http://validator.w3.org/check?uri=referer"><img
|
| 185 | src="http://www.w3.org/Icons/valid-html401"
|
| 186 | alt="Valid HTML 4.01!" height="31" width="88"></a>
|
| 187 | <a href="http://validator.w3.org/check?uri=referer"><img
|
| 188 | src="http://www.w3.org/Icons/valid-xhtml10"
|
| 189 | alt="Valid XHTML 1.0!" height="31" width="88" /></a>
|
| 190 | <a href="http://validator.w3.org/check?uri=referer"><img
|
| 191 | src="http://www.w3.org/Icons/valid-xhtml11"
|
| 192 | alt="Valid XHTML 1.1!" height="31" width="88" /></a>
|
| 193 | </p>
|
| 194 | </div--%>
|
| 195 |
|
| 196 | </body>
|
| 197 | </html>
|