incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r600865 - /incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/experimental/EctScriptEngine.java
Date Tue, 04 Dec 2007 10:09:15 GMT
Author: bdelacretaz
Date: Tue Dec  4 02:09:14 2007
New Revision: 600865

URL: http://svn.apache.org/viewvc?rev=600865&view=rev
Log:
SLING-114: path to microjax.js did not take context and servlet path into account, fixed

Modified:
    incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/experimental/EctScriptEngine.java

Modified: incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/experimental/EctScriptEngine.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/experimental/EctScriptEngine.java?rev=600865&r1=600864&r2=600865&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/experimental/EctScriptEngine.java
(original)
+++ incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/experimental/EctScriptEngine.java
Tue Dec  4 02:09:14 2007
@@ -32,9 +32,11 @@
 
 import org.apache.sling.api.HttpStatusCodeException;
 import org.apache.sling.api.SlingException;
+import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.scripting.SlingScript;
 import org.apache.sling.api.scripting.SlingScriptEngine;
+import org.apache.sling.api.wrappers.SlingRequestPaths;
 import org.apache.sling.commons.json.JSONException;
 import org.apache.sling.microsling.helpers.json.JsonItemWriter;
 import org.apache.sling.microsling.slingservlets.renderers.DefaultHtmlRenderer;
@@ -81,8 +83,14 @@
             w.println("</title>");
             
             // library scripts
+            final SlingHttpServletRequest request = (SlingHttpServletRequest)props.get(SlingScriptEngine.REQUEST);
             for(String lib : libraryScripts) {
-                w.println("<script src=\"" + lib + "\"></script>");  
+                final String fullScriptPath =             
+                    SlingRequestPaths.getContextPath(request)
+                    + SlingRequestPaths.getServletPath(request)
+                    + lib
+                ;
+                w.println("<script src=\"" + fullScriptPath + "\"></script>");
 
             }
             
             // onLoad method



Mime
View raw message