felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1685239 - in /felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal: console/HttpServicePlugin.java dispatch/Dispatcher.java dispatch/InvocationChain.java
Date Sat, 13 Jun 2015 11:10:19 GMT
Author: cziegeler
Date: Sat Jun 13 11:10:19 2015
New Revision: 1685239

URL: http://svn.apache.org/r1685239
Log:
FELIX-4543 : Update webconsole plugin

Modified:
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/InvocationChain.java

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java?rev=1685239&r1=1685238&r2=1685239&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
Sat Jun 13 11:10:19 2015
@@ -362,17 +362,21 @@ public class HttpServicePlugin extends H
         for(final String val : columns)
         {
             pw.print("<td>");
-            String text = escapeXml(val).replace("\n", "<br/>");
-            int pos;
-            while ( (pos = text.indexOf("${#link:")) != -1) {
-                final int endPos = text.indexOf("}", pos);
-                final int bundleId = Integer.valueOf(text.substring(pos + 8, endPos));
-                final int tokenEndPos = text.indexOf("${link#}", pos);
+            if ( val != null )
+            {
+                String text = escapeXml(val).replace("\n", "<br/>");
+                int pos;
+                while ( (pos = text.indexOf("${#link:")) != -1)
+                {
+                    final int endPos = text.indexOf("}", pos);
+                    final int bundleId = Integer.valueOf(text.substring(pos + 8, endPos));
+                    final int tokenEndPos = text.indexOf("${link#}", pos);
 
-                text = text.substring(0, pos) + "<a href=\"${appRoot}/bundles/" + String.valueOf(bundleId)
+ "\">" +
-                       text.substring(endPos + 1, tokenEndPos) + "</a>" + text.substring(tokenEndPos
+ 8);
+                    text = text.substring(0, pos) + "<a href=\"${appRoot}/bundles/" +
String.valueOf(bundleId) + "\">" +
+                           text.substring(endPos + 1, tokenEndPos) + "</a>" + text.substring(tokenEndPos
+ 8);
+                }
+                pw.print(text);
             }
-            pw.print(text);
             pw.println("</td>");
         }
 

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java?rev=1685239&r1=1685238&r2=1685239&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
Sat Jun 13 11:10:19 2015
@@ -56,6 +56,7 @@ import org.apache.felix.http.base.intern
 import org.apache.felix.http.base.internal.handler.FilterHandler;
 import org.apache.felix.http.base.internal.handler.HttpSessionWrapper;
 import org.apache.felix.http.base.internal.handler.ServletHandler;
+import org.apache.felix.http.base.internal.logger.SystemLogger;
 import org.apache.felix.http.base.internal.registry.HandlerRegistry;
 import org.apache.felix.http.base.internal.registry.PathResolution;
 import org.apache.felix.http.base.internal.registry.PerContextHandlerRegistry;
@@ -622,6 +623,7 @@ public final class Dispatcher implements
         }
         catch ( final Exception e)
         {
+            SystemLogger.error("Exception while processing request to " + requestURI, e);
             req.setAttribute(RequestDispatcher.ERROR_EXCEPTION, e);
             req.setAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE, e.getClass().getName());
 
@@ -683,8 +685,8 @@ public final class Dispatcher implements
      */
     void forward(final ServletResolution resolution, HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException
     {
-        String requestURI = getRequestURI(request);
-        FilterHandler[] filterHandlers = this.handlerRegistry.getFilters(resolution, DispatcherType.FORWARD,
requestURI);
+        final String requestURI = getRequestURI(request);
+        final FilterHandler[] filterHandlers = this.handlerRegistry.getFilters(resolution,
DispatcherType.FORWARD, requestURI);
 
         invokeChain(resolution.handler, filterHandlers, request, response);
     }
@@ -696,8 +698,8 @@ public final class Dispatcher implements
      */
     void include(final ServletResolution resolution, HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException
     {
-        String requestURI = getRequestURI(request);
-        FilterHandler[] filterHandlers = this.handlerRegistry.getFilters(resolution, DispatcherType.INCLUDE,
requestURI);
+        final String requestURI = getRequestURI(request);
+        final FilterHandler[] filterHandlers = this.handlerRegistry.getFilters(resolution,
DispatcherType.INCLUDE, requestURI);
 
         invokeChain(resolution.handler, filterHandlers, request, response);
     }

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/InvocationChain.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/InvocationChain.java?rev=1685239&r1=1685238&r2=1685239&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/InvocationChain.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/InvocationChain.java
Sat Jun 13 11:10:19 2015
@@ -46,7 +46,7 @@ public class InvocationChain implements
     }
 
     @Override
-    public final void doFilter(ServletRequest req, ServletResponse res) throws IOException,
ServletException
+    public final void doFilter(@Nonnull final ServletRequest req, @Nonnull final  ServletResponse
res) throws IOException, ServletException
     {
         if ( this.index == -1 )
         {



Mime
View raw message