You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2007/06/19 00:40:16 UTC
svn commit: r548516 -
/incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/webapp/WebAppServletHost.java
Author: jsdelfino
Date: Mon Jun 18 15:40:13 2007
New Revision: 548516
URL: http://svn.apache.org/viewvc?view=rev&rev=548516
Log:
Support serving web resources in the embedded Tomcat and Jetty servers, ignore registration of our DefaultResourceServlet in the webapp host.
Modified:
incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/webapp/WebAppServletHost.java
Modified: incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/webapp/WebAppServletHost.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/webapp/WebAppServletHost.java?view=diff&rev=548516&r1=548515&r2=548516
==============================================================================
--- incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/webapp/WebAppServletHost.java (original)
+++ incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/webapp/WebAppServletHost.java Mon Jun 18 15:40:13 2007
@@ -27,6 +27,7 @@
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
+import org.apache.tuscany.sca.http.DefaultResourceServlet;
import org.apache.tuscany.sca.http.ServletHost;
import org.apache.tuscany.sca.http.ServletMappingException;
@@ -50,7 +51,18 @@
public void addServletMapping(String path, Servlet servlet) throws ServletMappingException {
URI pathURI = URI.create(path);
- // for webapps just use the path and ignore the host and port
+
+ // Ignore registrations of our default resource servlet, as resources
+ // are already served by the web container
+ if (servlet instanceof DefaultResourceServlet) {
+ //TODO maybe ignore registration of the servlet only if it's
+ // mapped to "/" and still honor other registrations, to do this
+ // we will need a way to determine what's the default servlet
+ // in the web container that we are running in.
+ return;
+ }
+
+ // For webapps just use the path and ignore the host and port
servlets.put(pathURI.getPath(), servlet);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org