FELIX-4543 : Update webconsole plugin
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1685239 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java b/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
index b2d3dc4..34164f9 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
@@ -362,17 +362,21 @@
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>");
}
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java b/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
index ad7a327..9e3d671 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
@@ -56,6 +56,7 @@
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 @@
}
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 @@
*/
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 @@
*/
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);
}
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/InvocationChain.java b/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/InvocationChain.java
index eda9509..c541591 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/InvocationChain.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/InvocationChain.java
@@ -46,7 +46,7 @@
}
@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 )
{