Author: remy.maucherat(a)jboss.com
Date: 2008-03-17 22:07:05 -0400 (Mon, 17 Mar 2008)
New Revision: 526
Modified:
trunk/java/org/apache/catalina/manager/Constants.java
trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
trunk/java/org/apache/catalina/manager/StatusTransformer.java
trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java
Log:
- Update to more polished CSS, part 2.
Modified: trunk/java/org/apache/catalina/manager/Constants.java
===================================================================
--- trunk/java/org/apache/catalina/manager/Constants.java 2008-03-17 22:28:25 UTC (rev
525)
+++ trunk/java/org/apache/catalina/manager/Constants.java 2008-03-18 02:07:05 UTC (rev
526)
@@ -43,14 +43,12 @@
"\n";
public static final String MESSAGE_SECTION =
- "<table border=\"1\" cellspacing=\"0\"
cellpadding=\"3\">\n" +
+ "<table border=\"0\"
class=\"message\"><tbody>\n" +
" <tr>\n" +
- " <td class=\"row-left\" width=\"10%\">" +
-
"<small><strong>{0}</strong></small> </td>\n"
+
- " <td
class=\"row-left\"><pre>{1}</pre></td>\n" +
+ " <td
width=\"10%\"><strong>{0}</strong></td>" +
+ " <td>{1}</td>\n" +
" </tr>\n" +
- "</table>\n" +
- "<br>\n" +
+ "</tbody></table>\n" +
"\n";
public static final String MANAGER_SECTION =
@@ -76,30 +74,29 @@
"<div class=\"maincol\">\n";
public static final String SERVER_HEADER_SECTION =
- "<table border=\"1\" cellspacing=\"0\"
cellpadding=\"3\">\n" +
- "<tr>\n" +
- " <td colspan=\"6\"
class=\"title\">{0}</td>\n" +
- "</tr>\n" +
- "<tr>\n" +
- " <td
class=\"header-center\"><small>{1}</small></td>\n" +
- " <td
class=\"header-center\"><small>{2}</small></td>\n" +
- " <td
class=\"header-center\"><small>{3}</small></td>\n" +
- " <td
class=\"header-center\"><small>{4}</small></td>\n" +
- " <td
class=\"header-center\"><small>{5}</small></td>\n" +
- " <td
class=\"header-center\"><small>{6}</small></td>\n" +
+ "<table width=\"100%\" cellspacing=\"0\"
class=\"tableStyle\" >\n" +
+ "<thead>\n" +
+ " <th colspan=\"6\">{0}</th>\n" +
+ "</thead>\n" +
+ "<tr class=\"UnsortableTableHeader\">\n" +
+ " <td>{1}</td>\n" +
+ " <td>{2}</td>\n" +
+ " <td>{3}</td>\n" +
+ " <td>{4}</td>\n" +
+ " <td>{5}</td>\n" +
+ " <td>{6}</td>\n" +
"</tr>\n";
public static final String SERVER_ROW_SECTION =
- "<tr>\n" +
- " <td
class=\"row-center\"><small>{0}</small></td>\n" +
- " <td
class=\"row-center\"><small>{1}</small></td>\n" +
- " <td
class=\"row-center\"><small>{2}</small></td>\n" +
- " <td
class=\"row-center\"><small>{3}</small></td>\n" +
- " <td
class=\"row-center\"><small>{4}</small></td>\n" +
- " <td
class=\"row-center\"><small>{5}</small></td>\n" +
+ "<tbody><tr class=\"oddRow\">\n" +
+ " <td class=\"first\">{0}</small></td>\n"
+
+ " <td>{1}</td>\n" +
+ " <td>{2}</td>\n" +
+ " <td>{3}</td>\n" +
+ " <td>{4}</td>\n" +
+ " <td>{5}</td>\n" +
"</tr>\n" +
- "</table>\n" +
- "<br>\n" +
+ "</tbody></table>\n" +
"\n";
public static final String HTML_TAIL_SECTION =
Modified: trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
===================================================================
--- trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java 2008-03-17 22:28:25 UTC
(rev 525)
+++ trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java 2008-03-18 02:07:05 UTC
(rev 526)
@@ -368,17 +368,17 @@
String appsExpire = sm.getString("htmlManagerServlet.appsExpire");
Iterator iterator = sortedContextPathsMap.entrySet().iterator();
- boolean isHighlighted = true;
boolean isDeployed = true;
- String highlightColor = null;
+ boolean isHighlighted = false;
+ String highlightStyle = null;
while (iterator.hasNext()) {
// Bugzilla 34818, alternating row colors
isHighlighted = !isHighlighted;
if(isHighlighted) {
- highlightColor = "#C3F3C3";
+ highlightStyle = "oddRow";
} else {
- highlightColor = "#FFFFFF";
+ highlightStyle = "evenRow";
}
Map.Entry entry = (Map.Entry) iterator.next();
@@ -413,9 +413,8 @@
} else {
args[4] = new Integer(0);
}
+ args[5] = highlightStyle;
- args[5] = highlightColor;
-
writer.print
(MessageFormat.format(APPS_ROW_DETAILS_SECTION, args));
@@ -450,7 +449,7 @@
}
args[12] = sm.getString("htmlManagerServlet.expire.unit");
- args[13] = highlightColor;
+ args[13] = highlightStyle;
if (context.getPath().equals(this.context.getPath())) {
writer.print(MessageFormat.format(
@@ -954,178 +953,137 @@
// (maximium of 10).
private static final String APPS_HEADER_SECTION =
- "<table border=\"1\" cellspacing=\"0\"
cellpadding=\"3\">\n" +
+ "<table width=\"100%\" cellspacing=\"0\"
class=\"tableStyle\" >\n" +
"<tr>\n" +
- " <td colspan=\"5\"
class=\"title\">{0}</td>\n" +
+ " <th colspan=\"5\">{0}</th>\n" +
"</tr>\n" +
- "<tr>\n" +
- " <td
class=\"header-left\"><small>{1}</small></td>\n" +
- " <td
class=\"header-left\"><small>{2}</small></td>\n" +
- " <td
class=\"header-center\"><small>{3}</small></td>\n" +
- " <td
class=\"header-center\"><small>{4}</small></td>\n" +
- " <td
class=\"header-left\"><small>{5}</small></td>\n" +
- "</tr>\n";
+ "<tbody>\n" +
+ " <tr class=\"UnsortableTableHeader\">\n" +
+ " <td>{1}</td>\n" +
+ " <td>{2}</td>\n" +
+ " <td>{3}</td>\n" +
+ " <td>{4}</td>\n" +
+ " <td>{5}</td>\n" +
+ " </tr>\n";
private static final String APPS_ROW_DETAILS_SECTION =
- "<tr>\n" +
- " <td class=\"row-left\" bgcolor=\"{5}\"
rowspan=\"2\"><small><a
href=\"{0}\">{0}</a>" +
- "</small></td>\n" +
- " <td class=\"row-left\" bgcolor=\"{5}\"
rowspan=\"2\"><small>{1}</small></td>\n" +
- " <td class=\"row-center\" bgcolor=\"{5}\"
rowspan=\"2\"><small>{2}</small></td>\n" +
- " <td class=\"row-center\" bgcolor=\"{5}\"
rowspan=\"2\">" +
- "<small><a href=\"{3}\"
target=\"_new\">{4}</a></small></td>\n";
+ "<tr class=\"{5}\">\n" +
+ " <td class=\"first\" rowspan=\"2\"><a
href=\"{0}\">{0}</a></td>\n" +
+ " <td rowspan=\"2\">{1}</td>\n" +
+ " <td rowspan=\"2\">{2}</td>\n" +
+ " <td rowspan=\"2\"><a href=\"{3}\"
target=\"_new\">{4}</a></td>\n";
private static final String MANAGER_APP_ROW_BUTTON_SECTION =
- " <td class=\"row-left\" bgcolor=\"{13}\">\n"
+
- " <small>\n" +
+ " <td>\n" +
" {1} \n" +
" {3} \n" +
" {5} \n" +
" {7} \n" +
- " </small>\n" +
" </td>\n" +
- "</tr><tr>\n" +
- " <td class=\"row-left\" bgcolor=\"{13}\">\n"
+
+ "</tr><tr class=\"{13}\">\n" +
+ " <td>\n" +
" <form method=\"POST\" action=\"{8}\">\n"
+
- " <small>\n" +
- " <input type=\"submit\"
value=\"{9}\"> {10} <input type=\"text\"
name=\"idle\" size=\"5\"
value=\"{11}\"> {12} \n" +
- " </small>\n" +
+ " <input type=\"submit\" value=\"{9}\"
class=\"buttonmed\"> {10} <input type=\"text\"
name=\"idle\" size=\"5\"
value=\"{11}\"> {12} \n" +
" </form>\n" +
" </td>\n" +
"</tr>\n";
private static final String STARTED_DEPLOYED_APPS_ROW_BUTTON_SECTION =
- " <td class=\"row-left\" bgcolor=\"{13}\">\n"
+
- " <small>\n" +
+ " <td>\n" +
" {1} \n" +
" <a href=\"{2}\"
onclick=\"return(confirm('''Are you
sure?'''))\">{3}</a> \n" +
" <a href=\"{4}\"
onclick=\"return(confirm('''Are you
sure?'''))\">{5}</a> \n" +
" <a href=\"{6}\"
onclick=\"return(confirm('''Are you
sure?'''))\">{7}</a> \n" +
- " </small>\n" +
" </td>\n" +
- " </tr><tr>\n" +
- " <td class=\"row-left\" bgcolor=\"{13}\">\n"
+
+ " </tr><tr class=\"{13}\">\n" +
+ " <td>\n" +
" <form method=\"POST\" action=\"{8}\">\n"
+
- " <small>\n" +
- " <input type=\"submit\"
value=\"{9}\"> {10} <input type=\"text\"
name=\"idle\" size=\"5\"
value=\"{11}\"> {12} \n" +
- " </small>\n" +
+ " <input type=\"submit\" value=\"{9}\"
class=\"buttonmed\"> {10} <input type=\"text\"
name=\"idle\" size=\"5\"
value=\"{11}\"> {12} \n" +
" </form>\n" +
" </td>\n" +
"</tr>\n";
private static final String STOPPED_DEPLOYED_APPS_ROW_BUTTON_SECTION =
- " <td class=\"row-left\" bgcolor=\"{13}\"
rowspan=\"2\">\n" +
- " <small>\n" +
+ " <td rowspan=\"2\">\n" +
" <a href=\"{0}\"
onclick=\"return(confirm('''Are you
sure?'''))\">{1}</a> \n" +
" {3} \n" +
" {5} \n" +
" <a href=\"{6}\"
onclick=\"return(confirm('''Are you sure? This will delete the
application.'''))\">{7}</a> \n" +
- " </small>\n" +
" </td>\n" +
- "</tr>\n<tr></tr>\n";
+ "</tr>\n<tr class=\"{13}\"></tr>\n";
private static final String STARTED_NONDEPLOYED_APPS_ROW_BUTTON_SECTION =
- " <td class=\"row-left\" bgcolor=\"{13}\"
rowspan=\"2\">\n" +
- " <small>\n" +
+ " <td rowspan=\"2\">\n" +
" {1} \n" +
" <a href=\"{2}\"
onclick=\"return(confirm('''Are you
sure?'''))\">{3}</a> \n" +
" <a href=\"{4}\"
onclick=\"return(confirm('''Are you
sure?'''))\">{5}</a> \n" +
" {7} \n" +
- " </small>\n" +
" </td>\n" +
- "</tr>\n<tr></tr>\n";
+ "</tr>\n<tr class=\"{13}\"></tr>\n";
private static final String STOPPED_NONDEPLOYED_APPS_ROW_BUTTON_SECTION =
- " <td class=\"row-left\" bgcolor=\"{13}\"
rowspan=\"2\">\n" +
- " <small>\n" +
+ " <td rowspan=\"2\">\n" +
" <a href=\"{0}\"
onclick=\"return(confirm('''Are you
sure?'''))\">{1}</a> \n" +
" {3} \n" +
" {5} \n" +
" {7} \n" +
- " </small>\n" +
" </td>\n" +
- "</tr>\n<tr></tr>\n";
+ "</tr>\n<tr class=\"{13}\"></tr>\n";
private static final String DEPLOY_SECTION =
- "</table>\n" +
- "<br>\n" +
- "<table border=\"1\" cellspacing=\"0\"
cellpadding=\"3\">\n" +
+ "</tbody></table>\n" +
+ "<table width=\"100%\" cellspacing=\"0\"
class=\"tableStyle\">\n" +
"<tr>\n" +
- " <td colspan=\"2\"
class=\"title\">{0}</td>\n" +
+ " <th colspan=\"2\">{0}</th>\n" +
"</tr>\n" +
- "<tr>\n" +
- " <td colspan=\"2\"
class=\"header-left\"><small>{1}</small></td>\n" +
+ "<tbody><tr class=\"UnsortableTableHeader\">\n"
+
+ " <td colspan=\"2\">{1}</td>\n" +
"</tr>\n" +
- "<tr>\n" +
- " <td colspan=\"2\">\n" +
+ "<tr class=\"oddRow\">\n" +
+ " <td colspan=\"2\" class=\"first\">\n" +
"<form method=\"get\" action=\"{2}\">\n" +
- "<table cellspacing=\"0\"
cellpadding=\"3\">\n" +
+ "<table cellspacing=\"0\" cellpadding=\"3\"
style=\"border:0px;\"><tbody>\n" +
"<tr>\n" +
- " <td class=\"row-right\">\n" +
- " <small>{3}</small>\n" +
- " </td>\n" +
- " <td class=\"row-left\">\n" +
- " <input type=\"text\" name=\"deployPath\"
size=\"20\">\n" +
- " </td>\n" +
+ " <td style=\"border:0px;\">{3}</td>\n" +
+ " <td style=\"border:0px;\"><input
type=\"text\" name=\"deployPath\"
size=\"20\"></td>\n" +
"</tr>\n" +
"<tr>\n" +
- " <td class=\"row-right\">\n" +
- " <small>{4}</small>\n" +
- " </td>\n" +
- " <td class=\"row-left\">\n" +
- " <input type=\"text\" name=\"deployConfig\"
size=\"20\">\n" +
- " </td>\n" +
+ " <td style=\"border:0px;\">{4}</td>\n" +
+ " <td style=\"border:0px;\"><input
type=\"text\" name=\"deployConfig\"
size=\"20\"></td>\n" +
"</tr>\n" +
"<tr>\n" +
- " <td class=\"row-right\">\n" +
- " <small>{5}</small>\n" +
- " </td>\n" +
- " <td class=\"row-left\">\n" +
- " <input type=\"text\" name=\"deployWar\"
size=\"40\">\n" +
- " </td>\n" +
+ " <td style=\"border:0px;\">{5}</td>\n" +
+ " <td style=\"border:0px;\"><input
type=\"text\" name=\"deployWar\"
size=\"40\"></td>\n" +
"</tr>\n" +
"<tr>\n" +
- " <td class=\"row-right\">\n" +
- " \n" +
- " </td>\n" +
- " <td class=\"row-left\">\n" +
- " <input type=\"submit\" value=\"{6}\">\n"
+
- " </td>\n" +
+ " <td style=\"border:0px;\"> </td>\n" +
+ " <td style=\"border:0px;\"><input
type=\"submit\" value=\"{6}\"
class=\"buttonmed\"></td>\n" +
"</tr>\n" +
- "</table>\n" +
+ "</tbody></table>\n" +
"</form>\n" +
"</td>\n" +
"</tr>\n";
private static final String UPLOAD_SECTION =
- "<tr>\n" +
- " <td colspan=\"2\"
class=\"header-left\"><small>{0}</small></td>\n" +
+ "<tr class=\"UnsortableTableHeader\">\n" +
+ " <th colspan=\"2\">{0}</th>\n" +
"</tr>\n" +
- "<tr>\n" +
- " <td colspan=\"2\">\n" +
+ "<tr class=\"evenRow\">\n" +
+ " <td colspan=\"2\" class=\"first\">\n" +
"<form action=\"{1}\" method=\"post\" " +
"enctype=\"multipart/form-data\">\n" +
- "<table cellspacing=\"0\"
cellpadding=\"3\">\n" +
+ "<table cellspacing=\"0\"
cellpadding=\"3\"><tbody>\n" +
"<tr>\n" +
- " <td class=\"row-right\">\n" +
- " <small>{2}</small>\n" +
- " </td>\n" +
- " <td class=\"row-left\">\n" +
- " <input type=\"file\" name=\"deployWar\"
size=\"40\">\n" +
- " </td>\n" +
+ " <td style=\"border:0px;\">{2}</td>\n" +
+ " <td style=\"border:0px;\"><input
type=\"file\" name=\"deployWar\"
size=\"40\"></td>\n" +
"</tr>\n" +
"<tr>\n" +
- " <td class=\"row-right\">\n" +
- " \n" +
- " </td>\n" +
- " <td class=\"row-left\">\n" +
- " <input type=\"submit\" value=\"{3}\">\n"
+
- " </td>\n" +
+ " <td style=\"border:0px;\"> </td>\n" +
+ " <td style=\"border:0px;\"><input
type=\"submit\" value=\"{3}\"
class=\"buttonmed\"></td>\n" +
"</tr>\n" +
- "</table>\n" +
+ "</tbody></table>\n" +
"</form>\n" +
- "</table>\n" +
- "<br>\n" +
+ "</td></tr></tbody></table>\n" +
"\n";
}
Modified: trunk/java/org/apache/catalina/manager/StatusTransformer.java
===================================================================
--- trunk/java/org/apache/catalina/manager/StatusTransformer.java 2008-03-17 22:28:25 UTC
(rev 525)
+++ trunk/java/org/apache/catalina/manager/StatusTransformer.java 2008-03-18 02:07:05 UTC
(rev 526)
@@ -183,23 +183,22 @@
if (ok) {
if (mode == 0){
- writer.print("<h1>OS</h1>");
+ writer.print("<h3>OS</h3>");
writer.print("<p>");
- writer.print(" Physical memory: ");
+ writer.print(" <strong>Physical memory:</strong>
");
writer.print(formatSize(new Long(result[0]), true));
- writer.print(" Available memory: ");
+ writer.print("<br><strong>Available
memory:</strong> ");
writer.print(formatSize(new Long(result[1]), true));
- writer.print(" Total page file: ");
+ writer.print("<br><strong>Total page
file:</strong> ");
writer.print(formatSize(new Long(result[2]), true));
- writer.print(" Free page file: ");
+ writer.print("<br><strong>Free page file:</strong>
");
writer.print(formatSize(new Long(result[3]), true));
- writer.print(" Memory load: ");
+ writer.print("<br><strong>Memory load:</strong>
");
writer.print(new Long(result[6]));
- writer.print("<br>");
- writer.print(" Process kernel time: ");
+ writer.print("<br><strong>Process kernel
time:</strong> ");
writer.print(formatTime(new Long(result[11] / 1000), true));
- writer.print(" Process user time: ");
+ writer.print("<br><strong>Process user
time:</strong> ");
writer.print(formatTime(new Long(result[12] / 1000), true));
writer.print("</p>");
} else if (mode == 1){
@@ -217,16 +216,16 @@
throws Exception {
if (mode == 0){
- writer.print("<h1>JVM</h1>");
+ writer.print("<h3>JVM</h3>");
writer.print("<p>");
- writer.print(" Free memory: ");
+ writer.print(" <strong>Free memory:</strong> ");
writer.print(formatSize
(new Long(Runtime.getRuntime().freeMemory()), true));
- writer.print(" Total memory: ");
+ writer.print(" <br><strong>Total memory:</strong>
");
writer.print(formatSize
(new Long(Runtime.getRuntime().totalMemory()), true));
- writer.print(" Max memory: ");
+ writer.print(" <br><strong>Max memory:</strong>
");
writer.print(formatSize
(new Long(Runtime.getRuntime().maxMemory()), true));
writer.print("</p>");
@@ -251,32 +250,29 @@
ObjectName tpName, String name,
MBeanServer mBeanServer,
Vector globalRequestProcessors,
- Vector requestProcessors,
- int mode)
+ Vector requestProcessors, int mode)
throws Exception {
if (mode == 0) {
- writer.print("<h1>");
+ writer.print("<h3>");
writer.print(name);
- writer.print("</h1>");
+ writer.print("</h3>");
writer.print("<p>");
- writer.print(" Max threads: ");
+ writer.print(" <strong>Max threads:</strong> ");
writer.print(mBeanServer.getAttribute(tpName, "maxThreads"));
- writer.print(" Current thread count: ");
+ writer.print(" <br><strong>Current thread
count:</strong> ");
writer.print(mBeanServer.getAttribute(tpName,
"currentThreadCount"));
- writer.print(" Current thread busy: ");
+ writer.print(" <br><strong>Current thread
busy:</strong> ");
writer.print(mBeanServer.getAttribute(tpName,
"currentThreadsBusy"));
try {
Object value = mBeanServer.getAttribute(tpName,
"keepAliveCount");
- writer.print(" Keeped alive sockets count: ");
+ writer.print(" <br><strong>Keeped alive sockets
count:</strong> ");
writer.print(value);
} catch (Exception e) {
// Ignore
}
- writer.print("<br>");
-
ObjectName grpName = null;
Enumeration enumeration = globalRequestProcessors.elements();
@@ -291,41 +287,52 @@
return;
}
- writer.print(" Max processing time: ");
+ writer.print(" <br><strong>Max processing
time:</strong> ");
writer.print(formatTime(mBeanServer.getAttribute
(grpName, "maxTime"), false));
- writer.print(" Processing time: ");
+ writer.print(" <br><strong>Processing time:</strong>
");
writer.print(formatTime(mBeanServer.getAttribute
(grpName, "processingTime"), true));
- writer.print(" Request count: ");
+ writer.print(" <br><strong>Request count:</strong>
");
writer.print(mBeanServer.getAttribute(grpName, "requestCount"));
- writer.print(" Error count: ");
+ writer.print(" <br><strong>Error count:</strong>
");
writer.print(mBeanServer.getAttribute(grpName, "errorCount"));
- writer.print(" Bytes received: ");
+ writer.print(" <br><strong>Bytes received:</strong>
");
writer.print(formatSize(mBeanServer.getAttribute
(grpName, "bytesReceived"), true));
- writer.print(" Bytes sent: ");
+ writer.print(" <br><strong>Bytes sent:</strong>
");
writer.print(formatSize(mBeanServer.getAttribute
(grpName, "bytesSent"), true));
writer.print("</p>");
- writer.print("<table
border=\"0\"><tr><th>Stage</th><th>Time</th><th>B
Sent</th><th>B
Recv</th><th>Client</th><th>VHost</th><th>Request</th></tr>");
+ writer.print("<table width=\"100%\"
cellspacing=\"0\" class=\"tableStyle\">");
+ writer.print("<thead><th colspan=\"7\">");
+ writer.print(name);
+ writer.print("</th></thead>");
+ writer.print("<tr
class=\"UnsortableTableHeader\"><td>Stage</td><td>Time</td><td>B
Sent</td><td>B Received</td><td>Client</td><td>V.
Host</td><td>Request</td></tr><tbody>");
enumeration = requestProcessors.elements();
+ boolean isHighlighted = false;
+ String highlightStyle = null;
while (enumeration.hasMoreElements()) {
+ isHighlighted = !isHighlighted;
+ if(isHighlighted) {
+ highlightStyle = "oddRow";
+ } else {
+ highlightStyle = "evenRow";
+ }
ObjectName objectName = (ObjectName) enumeration.nextElement();
if (name.equals(objectName.getKeyProperty("worker"))) {
- writer.print("<tr>");
+ writer.print("<tr class=\"");
+ writer.print(highlightStyle);
+ writer.print("\">");
writeProcessorState(writer, objectName, mBeanServer, mode);
writer.print("</tr>");
}
}
- writer.print("</table>");
+ writer.print("<caption align=\"bottom\">P: Parse and
prepare request S: Service F: Finishing R: Ready K:
Keepalive</caption></tbody></table>");
- writer.print("<p>");
- writer.print("P: Parse and prepare request S: Service F: Finishing R:
Ready K: Keepalive");
- writer.print("</p>");
} else if (mode == 1){
writer.write("<connector name='" + name +
"'>");
@@ -429,7 +436,7 @@
}
if (mode == 0) {
- writer.write("<td><strong>");
+ writer.write("<td
class=\"first\"><strong>");
writer.write(stageStr);
writer.write("</strong></td>");
@@ -575,8 +582,7 @@
Iterator iterator = hostsON.iterator();
while (iterator.hasNext()) {
ObjectName contextON = (ObjectName) iterator.next();
- writer.print("<a class=\"A.name\" name=\""
- + (count++) + ".0\">");
+ writer.print("<a name=\"" + (count++) +
".0\">");
writeContext(writer, contextON, mBeanServer, mode);
}
@@ -677,20 +683,20 @@
contextName = "";
}
- writer.print("<h1>");
+ writer.print("<h3>");
writer.print(name);
- writer.print("</h1>");
+ writer.print("</h3>");
writer.print("</a>");
writer.print("<p>");
Object startTime = mBeanServer.getAttribute(objectName,
"startTime");
- writer.print(" Start time: " +
+ writer.print(" <strong>Start time:</strong> " +
new Date(((Long) startTime).longValue()));
- writer.print(" Startup time: ");
+ writer.print(" <br><strong>Startup time:</strong>
");
writer.print(formatTime(mBeanServer.getAttribute
(objectName, "startupTime"), false));
- writer.print(" TLD scan time: ");
+ writer.print(" <br><strong>TLD scan time:</strong>
");
writer.print(formatTime(mBeanServer.getAttribute
(objectName, "tldScanTime"), false));
if (managerON != null) {
@@ -726,30 +732,29 @@
throws Exception {
if (mode == 0) {
- writer.print("<br>");
- writer.print(" Active sessions: ");
+ writer.print(" <br><strong>Active sessions:</strong>
");
writer.print(mBeanServer.getAttribute
(objectName, "activeSessions"));
- writer.print(" Session count: ");
+ writer.print(" <br><strong>Session count:</strong>
");
writer.print(mBeanServer.getAttribute
(objectName, "sessionCounter"));
- writer.print(" Max active sessions: ");
+ writer.print(" <br><strong>Max active
sessions:</strong> ");
writer.print(mBeanServer.getAttribute(objectName, "maxActive"));
- writer.print(" Rejected session creations: ");
+ writer.print(" <br><strong>Rejected session
creations:</strong> ");
writer.print(mBeanServer.getAttribute
(objectName, "rejectedSessions"));
- writer.print(" Expired sessions: ");
+ writer.print(" <br><strong>Expired sessions:</strong>
");
writer.print(mBeanServer.getAttribute
(objectName, "expiredSessions"));
- writer.print(" Longest session alive time: ");
+ writer.print(" <br><strong>Longest session alive
time:</strong> ");
writer.print(formatSeconds(mBeanServer.getAttribute(
objectName,
"sessionMaxAliveTime")));
- writer.print(" Average session alive time: ");
+ writer.print(" <br><strong>Average session alive
time:</strong> ");
writer.print(formatSeconds(mBeanServer.getAttribute(
objectName,
"sessionAverageAliveTime")));
- writer.print(" Processing time: ");
+ writer.print(" <br><strong>Processing time:</strong>
");
writer.print(formatTime(mBeanServer.getAttribute
(objectName, "processingTime"), false));
} else if (mode == 1) {
@@ -781,10 +786,9 @@
}
if (mode == 0) {
- writer.print("<br>");
- writer.print(" JSPs loaded: ");
+ writer.print(" <br><strong>JSPs loaded:</strong>
");
writer.print(jspCount);
- writer.print(" JSPs reloaded: ");
+ writer.print(" <br><strong>JSPs reloaded:</strong>
");
writer.print(jspReloadCount);
} else if (mode == 1) {
// for now we don't write out anything
@@ -820,20 +824,20 @@
writer.print("</h2>");
writer.print("<p>");
- writer.print(" Processing time: ");
+ writer.print(" <strong>Processing time:</strong> ");
writer.print(formatTime(mBeanServer.getAttribute
(objectName, "processingTime"), true));
- writer.print(" Max time: ");
+ writer.print(" <br><strong>Max time:</strong>
");
writer.print(formatTime(mBeanServer.getAttribute
(objectName, "maxTime"), false));
- writer.print(" Request count: ");
+ writer.print(" <br><strong>Request count:</strong>
");
writer.print(mBeanServer.getAttribute(objectName,
"requestCount"));
- writer.print(" Error count: ");
+ writer.print(" <br><strong>Error count:</strong>
");
writer.print(mBeanServer.getAttribute(objectName, "errorCount"));
- writer.print(" Load time: ");
+ writer.print(" <br><strong>Load time:</strong>
");
writer.print(formatTime(mBeanServer.getAttribute
(objectName, "loadTime"), false));
- writer.print(" Classloading time: ");
+ writer.print(" <br><strong>Classloading time:</strong>
");
writer.print(formatTime(mBeanServer.getAttribute
(objectName, "classLoadTime"), false));
writer.print("</p>");
Modified: trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java
===================================================================
--- trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java 2008-03-17
22:28:25 UTC (rev 525)
+++ trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java 2008-03-18
02:07:05 UTC (rev 526)
@@ -250,13 +250,23 @@
Iterator<Map.Entry<String,String>> iterator =
sortedHostNamesMap.entrySet().iterator();
+ boolean isHighlighted = false;
+ String highlightStyle = null;
while (iterator.hasNext()) {
Map.Entry<String,String> entry = iterator.next();
String hostName = (String) entry.getKey();
Host host = (Host) engine.findChild(hostName);
if (host != null ) {
- args = new Object[2];
+
+ isHighlighted = !isHighlighted;
+ if(isHighlighted) {
+ highlightStyle = "oddRow";
+ } else {
+ highlightStyle = "evenRow";
+ }
+
+ args = new Object[3];
args[0] = RequestUtil.filter(hostName);
String[] aliases = host.findAliases();
StringBuffer buf = new StringBuffer();
@@ -273,6 +283,8 @@
} else {
args[1] = RequestUtil.filter(buf.toString());
}
+
+ args[2] = highlightStyle;
writer.print
(MessageFormat.format(HOSTS_ROW_DETAILS_SECTION, args));
@@ -385,106 +397,76 @@
// (maximium of 10).
private static final String HOSTS_HEADER_SECTION =
- "<table border=\"1\" cellspacing=\"0\"
cellpadding=\"3\">\n" +
- "<tr>\n" +
- " <td colspan=\"5\"
class=\"title\">{0}</td>\n" +
- "</tr>\n" +
- "<tr>\n" +
- " <td
class=\"header-left\"><small>{0}</small></td>\n" +
- " <td
class=\"header-center\"><small>{1}</small></td>\n" +
- " <td
class=\"header-center\"><small>{2}</small></td>\n" +
+ "<table width=\"100%\" cellspacing=\"0\"
class=\"tableStyle\" >\n" +
+ "<thead><th
colspan=\"5\">{0}</th></thead>\n" +
+ "<tr class=\"UnsortableTableHeader\">\n" +
+ " <td>{0}</td>\n" +
+ " <td>{1}</td>\n" +
+ " <td>{2}</td>\n" +
"</tr>\n";
private static final String HOSTS_ROW_DETAILS_SECTION =
- "<tr>\n" +
- " <td class=\"row-left\"><small><a
href=\"http://{0}\">{0}</a>" +
- "</small></td>\n" +
- " <td
class=\"row-center\"><small>{1}</small></td>\n";
+ "<tr class=\"{2}\">\n" +
+ " <td class=\"first\"><a
href=\"http://{0}\">{0}</a></td>\n" +
+ " <td>{1}</td>\n";
private static final String MANAGER_HOST_ROW_BUTTON_SECTION =
- " <td class=\"row-left\">\n" +
- " <small>\n" +
+ " <td>\n" +
" {1} \n" +
" {3} \n" +
" {5} \n" +
- " </small>\n" +
" </td>\n" +
"</tr>\n";
private static final String HOSTS_ROW_BUTTON_SECTION =
- " <td class=\"row-left\" NOWRAP>\n" +
- " <small>\n" +
+ " <td NOWRAP>\n" +
" <a href=\"{0}\"
onclick=\"return(confirm(''{1} {6}\\n\\nAre you
sure?''))\">{1}</a> \n" +
" <a href=\"{2}\"
onclick=\"return(confirm(''{3} {6}\\n\\nAre you
sure?''))\">{3}</a> \n" +
" <a href=\"{4}\"
onclick=\"return(confirm(''{5} {6}\\n\\nAre you
sure?''))\">{5}</a> \n" +
- " </small>\n" +
" </td>\n" +
"</tr>\n";
private static final String ADD_SECTION_START =
"</table>\n" +
- "<br>\n" +
- "<table border=\"1\" cellspacing=\"0\"
cellpadding=\"3\">\n" +
+ "<table width=\"100%\" cellspacing=\"0\"
class=\"tableStyle\">\n" +
"<tr>\n" +
- " <td colspan=\"2\"
class=\"title\">{0}</td>\n" +
+ " <th colspan=\"2\">{0}</th>\n" +
"</tr>\n" +
- "<tr>\n" +
- " <td colspan=\"2\"
class=\"header-left\"><small>{1}</small></td>\n" +
- "</tr>\n" +
- "<tr>\n" +
- " <td colspan=\"2\">\n" +
+ "<tbody>\n" +
+ " <tr
class=\"UnsortableTableHeader\"><td>{1}</td></tr>\n"
+
+ "<tr class=\"oddRow\">\n" +
+ " <td colspan=\"2\" class=\"first\">\n" +
"<form method=\"get\" action=\"{2}\">\n" +
- "<table cellspacing=\"0\"
cellpadding=\"3\">\n" +
+ "<table cellpadding=\"3\" cellspacing=\"0\"
style=\"border:0px;\"><tbody>\n" +
"<tr>\n" +
- " <td class=\"row-right\">\n" +
- " <small>{3}</small>\n" +
- " </td>\n" +
- " <td class=\"row-left\">\n" +
- " <input type=\"text\" name=\"name\"
size=\"20\">\n" +
- " </td>\n" +
+ " <td style=\"border:0px;\">{3}</td>\n" +
+ " <td style=\"border:0px;\"><input
type=\"text\" name=\"name\"
size=\"20\"></td>\n" +
"</tr>\n" +
"<tr>\n" +
- " <td class=\"row-right\">\n" +
- " <small>{4}</small>\n" +
- " </td>\n" +
- " <td class=\"row-left\">\n" +
- " <input type=\"text\" name=\"aliases\"
size=\"64\">\n" +
- " </td>\n" +
+ " <td style=\"border:0px;\">{4}</td>\n" +
+ " <td style=\"border:0px;\"><input
type=\"text\" name=\"aliases\"
size=\"64\"></td>\n" +
"</tr>\n" +
"<tr>\n" +
- " <td class=\"row-right\">\n" +
- " <small>{5}</small>\n" +
- " </td>\n" +
- " <td class=\"row-left\">\n" +
- " <input type=\"text\" name=\"appBase\"
size=\"64\">\n" +
- " </td>\n" +
+ " <td style=\"border:0px;\">{5}</td>\n" +
+ " <td style=\"border:0px;\"><input
type=\"text\" name=\"appBase\"
size=\"64\"></td>\n" +
"</tr>\n" ;
private static final String ADD_SECTION_BOOLEAN =
"<tr>\n" +
- " <td class=\"row-right\">\n" +
- " <small>{0}</small>\n" +
- " </td>\n" +
- " <td class=\"row-left\">\n" +
- " <input type=\"checkbox\" name=\"{1}\"
{2}>\n" +
- " </td>\n" +
+ " <td
style=\"border:0px;\">{0}</small></td>\n" +
+ " <td style=\"border:0px;\"><input
type=\"checkbox\" name=\"{1}\" {2}></td>\n" +
"</tr>\n" ;
private static final String ADD_SECTION_END =
"<tr>\n" +
- " <td class=\"row-right\">\n" +
- " \n" +
- " </td>\n" +
- " <td class=\"row-left\">\n" +
- " <input type=\"submit\" value=\"{0}\">\n"
+
- " </td>\n" +
+ " <td style=\"border:0px;\"> </td>\n" +
+ " <td style=\"border:0px;\"><input
type=\"submit\" value=\"{0}\"
class=\"buttonmed\"></td>\n" +
"</tr>\n" +
- "</table>\n" +
+ "</tbody></table>\n" +
"</form>\n" +
"</td>\n" +
"</tr>\n" +
"</table>\n" +
- "<br>\n" +
"\n";
}