summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoResourceServlet.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoResourceServlet.java b/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoResourceServlet.java
index 20c9fe4959..dad72be5f2 100644
--- a/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoResourceServlet.java
+++ b/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoResourceServlet.java
@@ -30,6 +30,7 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.tuscany.sca.common.http.HTTPConstants;
import org.apache.tuscany.sca.common.http.HTTPContentTypeMapper;
+import org.apache.tuscany.sca.common.http.HTTPUtil;
/**
@@ -46,14 +47,18 @@ public class DojoResourceServlet extends HttpServlet {
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
+ String contextRoot = URLDecoder.decode(HTTPUtil.getContextRoot(request), HTTPConstants.CHARACTER_ENCODING_UTF8);
String path = URLDecoder.decode(request.getRequestURI(), HTTPConstants.CHARACTER_ENCODING_UTF8);
- if( path.startsWith("/dojo") ) {
+ if( path.startsWith(contextRoot + "/dojo") ) {
if( ! path.contains("tuscany/AtomService.js")) {
//this is a workaround where we need to have dojo files in its own folder
//to avoid clean target to clean other non dojo resources
+ path = path.substring(contextRoot.length());
path = "/dojo" + path;
}
+ } else if (path.startsWith(contextRoot)) {
+ path = path.substring(contextRoot.length() + 1);
} else if( path.startsWith("/")) {
path = path.substring(1);
}