felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1210837 - /felix/trunk/http/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/HttpWhiteboardWebConsolePlugin.java
Date Tue, 06 Dec 2011 09:56:25 GMT
Author: fmeschbe
Date: Tue Dec  6 09:56:25 2011
New Revision: 1210837

URL: http://svn.apache.org/viewvc?rev=1210837&view=rev
Log:
FELIX-3259 Improve WebConsole plugin

Modified:
    felix/trunk/http/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/HttpWhiteboardWebConsolePlugin.java

Modified: felix/trunk/http/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/HttpWhiteboardWebConsolePlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/HttpWhiteboardWebConsolePlugin.java?rev=1210837&r1=1210836&r2=1210837&view=diff
==============================================================================
--- felix/trunk/http/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/HttpWhiteboardWebConsolePlugin.java
(original)
+++ felix/trunk/http/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/HttpWhiteboardWebConsolePlugin.java
Tue Dec  6 09:56:25 2011
@@ -159,32 +159,42 @@ public class HttpWhiteboardWebConsolePlu
         pw.println("<tr>");
         pw.println("<th class='content container' colspan='4'>Orphan Servlets and Filters</td>");
         pw.println("</tr>");
-        pw.println("<tr>");
-        pw.println("<th class='content'>Context ID</td>");
-        pw.println("<th class='content'>Servlets and Filters</td>");
-        pw.println("</tr>");
-
-        for (Entry<String, Set<AbstractMapping>> entry : mappings.entrySet())
+        if (mappings.isEmpty())
+        {
+            pw.println("<tr>");
+            pw.println("<td class='content' colspan='4'><i>none</i></td>");
+            pw.println("</tr>");
+            pw.println("");
+        }
+        else
         {
-            pw.println("<tr class='content'>");
-            pw.println("<td class='content'>" + entry.getKey() + "</td>");
-            pw.println("<td class='content'>");
-            for (AbstractMapping mapping : entry.getValue())
+            pw.println("<tr>");
+            pw.println("<th class='content'>Context ID</td>");
+            pw.println("<th class='content' colspan='3'>Servlets and Filters</td>");
+            pw.println("</tr>");
+
+            for (Entry<String, Set<AbstractMapping>> entry : mappings.entrySet())
             {
-                if (mapping instanceof ServletMapping)
-                {
-                    pw.printf("Servlet %s (%s)", ((ServletMapping) mapping).getAlias(),
-                        ((ServletMapping) mapping).getServlet());
+                pw.println("<tr class='content'>");
+                pw.println("<td class='content'>" + entry.getKey() + "</td>");
+                pw.println("<td class='content' colspan='3'>");
+                for (AbstractMapping mapping : entry.getValue())
+                {
+                    if (mapping instanceof ServletMapping)
+                    {
+                        pw.printf("Servlet %s (%s)", ((ServletMapping) mapping).getAlias(),
+                            ((ServletMapping) mapping).getServlet());
+                    }
+                    else if (mapping instanceof FilterMapping)
+                    {
+                        pw.printf("Filter %s (%s)", ((FilterMapping) mapping).getPattern(),
+                            ((FilterMapping) mapping).getFilter());
+                    }
+                    pw.println("<br/>");
                 }
-                else if (mapping instanceof FilterMapping)
-                {
-                    pw.printf("Filter %s (%s)", ((FilterMapping) mapping).getPattern(),
-                        ((FilterMapping) mapping).getFilter());
-                }
-                pw.println("<br/>");
+                pw.println("</td>");
+                pw.println("</tr>");
             }
-            pw.println("</td>");
-            pw.println("</tr>");
         }
     }
 
@@ -232,33 +242,41 @@ public class HttpWhiteboardWebConsolePlu
     private void printOrphanMappingsTxt(PrintWriter pw, Map<String, Set<AbstractMapping>>
mappings)
     {
         pw.println("Orphan Servlets and Filters");
-        for (Entry<String, Set<AbstractMapping>> entry : mappings.entrySet())
+        if (mappings.isEmpty())
+        {
+            pw.println("  none");
+        }
+        else
         {
-            pw.print(entry.getKey() + " ==> { ");
-            boolean cont = false;
-            for (AbstractMapping mapping : entry.getValue())
-            {
-                if (cont)
-                {
-                    pw.print(", ");
-                }
-                else
-                {
-                    cont = true;
-                }
 
-                if (mapping instanceof ServletMapping)
-                {
-                    pw.printf("Servlet %s (%s)", ((ServletMapping) mapping).getAlias(),
-                        ((ServletMapping) mapping).getServlet());
-                }
-                else if (mapping instanceof FilterMapping)
-                {
-                    pw.printf("Filter %s (%s)", ((FilterMapping) mapping).getPattern(),
-                        ((FilterMapping) mapping).getFilter());
+            for (Entry<String, Set<AbstractMapping>> entry : mappings.entrySet())
+            {
+                pw.printf("  %s ==> { ", entry.getKey());
+                boolean cont = false;
+                for (AbstractMapping mapping : entry.getValue())
+                {
+                    if (cont)
+                    {
+                        pw.print(", ");
+                    }
+                    else
+                    {
+                        cont = true;
+                    }
+
+                    if (mapping instanceof ServletMapping)
+                    {
+                        pw.printf("Servlet %s (%s)", ((ServletMapping) mapping).getAlias(),
+                            ((ServletMapping) mapping).getServlet());
+                    }
+                    else if (mapping instanceof FilterMapping)
+                    {
+                        pw.printf("Filter %s (%s)", ((FilterMapping) mapping).getPattern(),
+                            ((FilterMapping) mapping).getFilter());
+                    }
                 }
+                pw.println(" }");
             }
-            pw.println(" }");
         }
     }
 



Mime
View raw message