Author: markt Date: Thu Jul 29 18:17:15 2010 New Revision: 980532 URL: http://svn.apache.org/viewvc?rev=980532&view=rev Log: Enable the HTML Manager application to differentiate between primary & backup sessions. Both can be invalidated Attributes can be viewed in both Attributes can only be removed from primary sessions
Modified: tomcat/trunk/webapps/manager/WEB-INF/jsp/sessionDetail.jsp tomcat/trunk/webapps/manager/WEB-INF/jsp/sessionsList.jsp Modified: tomcat/trunk/webapps/manager/WEB-INF/jsp/sessionDetail.jsp URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/manager/WEB-INF/jsp/sessionDetail.jsp?rev=980532&r1=980531&r2=980532&view=diff ============================================================================== --- tomcat/trunk/webapps/manager/WEB-INF/jsp/sessionDetail.jsp (original) +++ tomcat/trunk/webapps/manager/WEB-INF/jsp/sessionDetail.jsp Thu Jul 29 18:17:15 2010 @@ -135,7 +135,15 @@ <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" /> + <% + if ("Primary".equals(request.getAttribute("sessionType"))) { + %> + <input type="submit" value="Remove" /> + <% + } else { + out.print("Primary sessions only"); + } + %> </div> </form> </td> Modified: tomcat/trunk/webapps/manager/WEB-INF/jsp/sessionsList.jsp URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/manager/WEB-INF/jsp/sessionsList.jsp?rev=980532&r1=980531&r2=980532&view=diff ============================================================================== --- tomcat/trunk/webapps/manager/WEB-INF/jsp/sessionsList.jsp (original) +++ tomcat/trunk/webapps/manager/WEB-INF/jsp/sessionsList.jsp Thu Jul 29 18:17:15 2010 @@ -20,6 +20,7 @@ <%...@page import="java.util.Iterator" %> <%...@page import="org.apache.catalina.manager.JspHelper" %> <%...@page import="org.apache.catalina.Session" %> +<%...@page import="org.apache.catalina.ha.session.DeltaSession" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> @@ -69,6 +70,7 @@ <thead> <tr> <th><a onclick="document.getElementById('sessionsFormSort').value='id'; document.getElementById('refreshButton').click(); return true;">Session Id</a></th> + <th><a onclick="document.getElementById('sessionsFormSort').value='id'; document.getElementById('refreshButton').click(); return true;">Type</a></th> <th><a onclick="document.getElementById('sessionsFormSort').value='locale'; document.getElementById('refreshButton').click(); return true;">Guessed Locale</a></th> <th><a onclick="document.getElementById('sessionsFormSort').value='user'; document.getElementById('refreshButton').click(); return true;">Guessed User name</a></th> <th><a onclick="document.getElementById('sessionsFormSort').value='CreationTime'; document.getElementById('refreshButton').click(); return true;">Creation Time</a></th> @@ -82,6 +84,7 @@ <tfoot><%-- <tfoot> is the same as <thead> --%> <tr> <th><a onclick="document.getElementById('sessionsFormSort').value='id'; document.getElementById('refreshButton').click(); return true;">Session Id</a></th> + <th><a onclick="document.getElementById('sessionsFormSort').value='id'; document.getElementById('refreshButton').click(); return true;">Type</a></th> <th><a onclick="document.getElementById('sessionsFormSort').value='locale'; document.getElementById('refreshButton').click(); return true;">Guessed Locale</a></th> <th><a onclick="document.getElementById('sessionsFormSort').value='user'; document.getElementById('refreshButton').click(); return true;">Guessed User name</a></th> <th><a onclick="document.getElementById('sessionsFormSort').value='CreationTime'; document.getElementById('refreshButton').click(); return true;">Creation Time</a></th> @@ -97,11 +100,22 @@ while (iter.hasNext()) { Session currentSession = (Session) iter.next(); String currentSessionId = currentSession.getId(); + String type; + if (currentSession instanceof DeltaSession) { + if (((DeltaSession) currentSession).isPrimarySession()) { + type = "Primary"; + } else { + type = "Backup"; + } + } else { + type = "Primary"; + } %> <tr> - <td> -<input type="checkbox" name="sessionIds" value="<%= currentSessionId %>" /><a href="<%= submitUrl %>&action=sessionDetail&sessionId=<%= currentSessionId %>"><%= JspHelper.escapeXml(currentSessionId) %></a> + <td><input type="checkbox" name="sessionIds" value="<%= currentSessionId %>" /> + <a href="<%= submitUrl %>&action=sessionDetail&sessionId=<%= currentSessionId %>&sessionType=<%= type %>"><%= JspHelper.escapeXml(currentSessionId) %></a> </td> + <td style="text-align: center;"><%= type %></td> <td style="text-align: center;"><%= JspHelper.guessDisplayLocaleFromSession(currentSession) %></td> <td style="text-align: center;"><%= JspHelper.guessDisplayUserFromSession(currentSession) %></td> <td style="text-align: center;"><%= JspHelper.getDisplayCreationTimeForSession(currentSession) %></td> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org