You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cz...@apache.org on 2009/09/24 16:43:04 UTC
svn commit: r818499 - in
/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole:
AbstractWebConsolePlugin.java internal/WebConsolePluginAdapter.java
Author: cziegeler
Date: Thu Sep 24 14:43:04 2009
New Revision: 818499
URL: http://svn.apache.org/viewvc?rev=818499&view=rev
Log:
FELIX-1636 - Only perform the html check in the adapter.
Modified:
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/WebConsolePluginAdapter.java
Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java?rev=818499&r1=818498&r2=818499&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java (original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java Thu Sep 24 14:43:04 2009
@@ -32,6 +32,7 @@
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.fileupload.servlet.ServletRequestContext;
+import org.apache.felix.webconsole.internal.WebConsolePluginAdapter;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
@@ -128,19 +129,13 @@
/**
* Detects whether this request is intended to have the headers and
- * footers of this plugin be rendered or not. The decision is taken based
- * on whether and what extension the request URI has: If the request URI
- * has no extension or the the extension is <code>.html</code>, the request
- * is assumed to be rendered with header and footer. Otherwise the
- * headers and footers are omitted and the
- * {@link #renderContent(HttpServletRequest, HttpServletResponse)}
- * method is called without any decorations and without setting any
- * response headers.
+ * footers of this plugin be rendered or not. This method always returns
+ * <code>true</true> but has been overwritten in the
+ * {@link WebConsolePluginAdapter} for the plugins.
*/
protected boolean isHtmlRequest( final HttpServletRequest request )
{
- final String requestUri = request.getRequestURI();
- return requestUri.endsWith( ".html" ) || requestUri.lastIndexOf( '.' ) < 0;
+ return true;
}
Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/WebConsolePluginAdapter.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/WebConsolePluginAdapter.java?rev=818499&r1=818498&r2=818499&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/WebConsolePluginAdapter.java (original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/WebConsolePluginAdapter.java Thu Sep 24 14:43:04 2009
@@ -21,11 +21,7 @@
import java.io.IOException;
-import javax.servlet.Servlet;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
+import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -118,6 +114,22 @@
plugin.init( config );
}
+ /**
+ * Detects whether this request is intended to have the headers and
+ * footers of this plugin be rendered or not. The decision is taken based
+ * on whether and what extension the request URI has: If the request URI
+ * has no extension or the the extension is <code>.html</code>, the request
+ * is assumed to be rendered with header and footer. Otherwise the
+ * headers and footers are omitted and the
+ * {@link #renderContent(HttpServletRequest, HttpServletResponse)}
+ * method is called without any decorations and without setting any
+ * response headers.
+ */
+ protected boolean isHtmlRequest( final HttpServletRequest request )
+ {
+ final String requestUri = request.getRequestURI();
+ return requestUri.endsWith( ".html" ) || requestUri.lastIndexOf( '.' ) < 0;
+ }
/**
* Directly refer to the plugin's service method unless the request method