Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
771 blopes 1
<?xml version="1.0" encoding="UTF-8"?>
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=UTF-8" %>
19
<%@page import="java.util.Collection" %>
20
<%@page import="org.apache.catalina.manager.JspHelper" %>
21
<%@page import="org.apache.catalina.Session" %>
22
<%@page import="org.apache.catalina.ha.session.DeltaSession" %>
23
<%@page import="org.apache.catalina.util.ContextName" %>
24
<!DOCTYPE html
25
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
26
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
27
 
28
 
29
<%@page import="org.apache.catalina.manager.DummyProxySession"%><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
30
<% String path = (String) request.getAttribute("path");
31
   String version = (String) request.getAttribute("version");
32
   ContextName cn = new ContextName(path, version);
33
   String submitUrl = JspHelper.escapeXml(response.encodeURL(
34
           ((HttpServletRequest) pageContext.getRequest()).getRequestURI() +
35
           "?path=" + path + "&version=" + version));
36
   Collection<Session> activeSessions = (Collection<Session>) request.getAttribute("activeSessions");
37
%>
38
<head>
39
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
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="copyright" content="copyright 2005-2025 the Apache Software Foundation"/>
45
    <meta name="robots" content="noindex,nofollow,noarchive"/>
46
    <title>Sessions Administration for <%= JspHelper.escapeXml(cn.getDisplayName()) %></title>
47
    <link href="<%=request.getContextPath()%>/images/favicon.ico" rel="icon" type="image/x-icon" />
48
</head>
49
<body>
50
<h1>Sessions Administration for <%= JspHelper.escapeXml(cn.getDisplayName()) %></h1>
51
 
52
<p>Tips:</p>
53
<ul>
54
    <li>Click on a column to sort.</li>
55
    <li>To view a session details and/or remove a session attributes, click on its id.</li>
56
</ul>
57
 
58
<div class="error"><%= JspHelper.escapeXml(request.getAttribute("error")) %></div>
59
<div class="message"><%= JspHelper.escapeXml(request.getAttribute("message")) %></div>
60
 
61
<form action="<%= submitUrl %>" method="POST" id="sessionsForm">
62
    <fieldset><legend>Active HttpSessions information</legend>
63
        <input type="hidden" name="action" id="sessionsFormAction" value="injectSessions"/>
64
        <input type="hidden" name="sort" id="sessionsFormSort" value="<%= JspHelper.escapeXml(request.getAttribute("sort")) %>"/>
65
        <% String order = (String) request.getAttribute("order");
66
           if (order == null || "".equals(order)) {
67
               order = "ASC";
68
           }
69
        %>
70
        <input type="hidden" name="order" id="sessionsFormSortOrder" value="<%= JspHelper.escapeXml(order) %>"/>
71
        <input type="submit" name="refresh" id="refreshButton" value="Refresh Sessions list" onclick="document.getElementById('sessionsFormAction').value='refreshSessions'; return true;"/>
72
        <%= JspHelper.formatNumber(activeSessions.size()) %> active Sessions<br/>
73
        <table border="1" cellpadding="2" cellspacing="2" width="100%">
74
            <thead>
75
                <tr>
76
                    <th><a onclick="document.getElementById('sessionsFormSort').value='id'; document.getElementById('refreshButton').click(); return true;">Session Id</a></th>
77
                    <th><a onclick="document.getElementById('sessionsFormSort').value='id'; document.getElementById('refreshButton').click(); return true;">Type</a></th>
78
                    <th><a onclick="document.getElementById('sessionsFormSort').value='locale'; document.getElementById('refreshButton').click(); return true;">Guessed Locale</a></th>
79
                    <th><a onclick="document.getElementById('sessionsFormSort').value='user'; document.getElementById('refreshButton').click(); return true;">Guessed User name</a></th>
80
                    <th><a onclick="document.getElementById('sessionsFormSort').value='CreationTime'; document.getElementById('refreshButton').click(); return true;">Creation Time</a></th>
81
                    <th><a onclick="document.getElementById('sessionsFormSort').value='LastAccessedTime'; document.getElementById('refreshButton').click(); return true;">Last Accessed Time</a></th>
82
                    <th><a onclick="document.getElementById('sessionsFormSort').value='UsedTime'; document.getElementById('refreshButton').click(); return true;">Used Time</a></th>
83
                    <th><a onclick="document.getElementById('sessionsFormSort').value='InactiveTime'; document.getElementById('refreshButton').click(); return true;">Inactive Time</a></th>
84
                    <th><a onclick="document.getElementById('sessionsFormSort').value='TTL'; document.getElementById('refreshButton').click(); return true;"><span title="Time To Live">TTL</span></a></th>
85
                </tr>
86
            </thead>
87
            <% if (activeSessions.size() > 10) { %>
88
            <tfoot><%-- <tfoot> is the same as <thead> --%>
89
                <tr>
90
                    <th><a onclick="document.getElementById('sessionsFormSort').value='id'; document.getElementById('refreshButton').click(); return true;">Session Id</a></th>
91
                    <th><a onclick="document.getElementById('sessionsFormSort').value='id'; document.getElementById('refreshButton').click(); return true;">Type</a></th>
92
                    <th><a onclick="document.getElementById('sessionsFormSort').value='locale'; document.getElementById('refreshButton').click(); return true;">Guessed Locale</a></th>
93
                    <th><a onclick="document.getElementById('sessionsFormSort').value='user'; document.getElementById('refreshButton').click(); return true;">Guessed User name</a></th>
94
                    <th><a onclick="document.getElementById('sessionsFormSort').value='CreationTime'; document.getElementById('refreshButton').click(); return true;">Creation Time</a></th>
95
                    <th><a onclick="document.getElementById('sessionsFormSort').value='LastAccessedTime'; document.getElementById('refreshButton').click(); return true;">Last Accessed Time</a></th>
96
                    <th><a onclick="document.getElementById('sessionsFormSort').value='UsedTime'; document.getElementById('refreshButton').click(); return true;">Used Time</a></th>
97
                    <th><a onclick="document.getElementById('sessionsFormSort').value='InactiveTime'; document.getElementById('refreshButton').click(); return true;">Inactive Time</a></th>
98
                    <th><a onclick="document.getElementById('sessionsFormSort').value='TTL'; document.getElementById('refreshButton').click(); return true;"><span title="Time To Live">TTL</span></a></th>
99
                </tr>
100
            </tfoot>
101
            <% } // end if %>
102
            <tbody>
103
<%
104
    for (Session currentSession : activeSessions) {
105
       String currentSessionId = JspHelper.escapeXml(currentSession.getId());
106
       String type;
107
       if (currentSession instanceof DeltaSession) {
108
           if (((DeltaSession) currentSession).isPrimarySession()) {
109
               type = "Primary";
110
           } else {
111
               type = "Backup";
112
           }
113
       } else if (currentSession instanceof DummyProxySession) {
114
           type = "Proxy";
115
       } else {
116
           type = "Primary";
117
       }
118
%>
119
                <tr>
120
                    <td><input type="checkbox" name="sessionIds" value="<%= currentSessionId %>" />
121
                      <%
122
                        if ("Proxy".equals(type)) {
123
                            out.print(currentSessionId);
124
                        } else {
125
                      %>
126
                      <a href="<%= submitUrl %>&amp;action=sessionDetail&amp;sessionId=<%= currentSessionId %>&amp;sessionType=<%= type %>"><%= currentSessionId %></a>
127
                      <%
128
                        }
129
                      %>
130
                    </td>
131
                    <td style="text-align: center;"><%= type %></td>
132
                    <td style="text-align: center;"><%= JspHelper.guessDisplayLocaleFromSession(currentSession) %></td>
133
                    <td style="text-align: center;"><%= JspHelper.guessDisplayUserFromSession(currentSession) %></td>
134
                    <td style="text-align: center;"><%= JspHelper.getDisplayCreationTimeForSession(currentSession) %></td>
135
                    <td style="text-align: center;"><%= JspHelper.getDisplayLastAccessedTimeForSession(currentSession) %></td>
136
                    <td style="text-align: center;"><%= JspHelper.getDisplayUsedTimeForSession(currentSession) %></td>
137
                    <td style="text-align: center;"><%= JspHelper.getDisplayInactiveTimeForSession(currentSession) %></td>
138
                    <td style="text-align: center;"><%= JspHelper.getDisplayTTLForSession(currentSession) %></td>
139
                </tr>
140
<% } // end while %>
141
            </tbody>
142
        </table>
143
        <p style="text-align: center;">
144
            <input type="submit" name="invalidate" value="Invalidate selected Sessions" onclick="document.getElementById('sessionsFormAction').value='invalidateSessions'; return true;"/>
145
        </p>
146
    </fieldset>
147
</form>
148
 
149
<form method="GET" action="<%=request.getContextPath()%>/html">
150
  <p style="text-align: center;">
151
    <input type="submit" value="Return to main page" />
152
  </p>
153
</form>
154
 
155
<%--div style="display: none;">
156
<p>
157
    <a href="http://validator.w3.org/check?uri=referer"><img
158
        src="http://www.w3.org/Icons/valid-html401"
159
        alt="Valid HTML 4.01!" height="31" width="88"></a>
160
    <a href="http://validator.w3.org/check?uri=referer"><img
161
        src="http://www.w3.org/Icons/valid-xhtml10"
162
        alt="Valid XHTML 1.0!" height="31" width="88" /></a>
163
    <a href="http://validator.w3.org/check?uri=referer"><img
164
        src="http://www.w3.org/Icons/valid-xhtml11"
165
        alt="Valid XHTML 1.1!" height="31" width="88" /></a>
166
</p>
167
</div--%>
168
 
169
</body>
170
</html>