The result give me <script src="//combined?id=xxxx" .../> (problem is 2 "/")
i have a quickfix patch here ;
diff --git a/tag-main/src/com/granule/CompressTagHandler.java b/tag-main/src/com/granule/CompressTagHandler.java
index 4e9ed57..4250c43 100644
--- a/tag-main/src/com/granule/CompressTagHandler.java
+++ b/tag-main/src/com/granule/CompressTagHandler.java
@@ -51,7 +51,7 @@ public class CompressTagHandler {
private static final String JS_DUPLICATES = "granule_js_duplicates";
private static final String CSS_DUPLICATES = "granule_css_duplicates";
public CompressTagHandler(String id, String method, String options, String basepath) {
this.id = id;
this.method = method;
@@ -151,7 +151,12 @@ public class CompressTagHandler {
correction -= e.getEnd() - e.getBegin();
} else {
if (fragmentDescriptors.size() > 0) {
-
String newText = "<script src=\"" + request.getContextPath() + "/combined.js?id="
-
String contextPath = request.getContextPath();
-
if (request.getContextPath() == null || request.getContextPath().equals("") || request.getContextPath().equals("/"))
-
-
-
-
String newText = "<script src=\"" + contextPath + "/combined.js?id="
+ bundleId + "\"></script>";
newBody = newBody.substring(0, e.getBegin() + correction) + newText
+ newBody.substring(e.getEnd() + correction);
@@ -341,9 +346,13 @@ public class CompressTagHandler {
int p = ld.index;
sb.append(chunk.substring(start, links.get(p).getBegin()));
if (ld.scriptId != null) {
-
if (request.getContextPath() == null || request.getContextPath().equals("") || request.getContextPath().equals("/"))
-
-
-
}
Attribute a = links.get(p).getAttributes().get("href");
sb.append(chunk.substring(links.get(p).getBegin(), a.getBegin()));
-
sb.append("href=\"").append(request.getContextPath()).
-
sb.append("href=\"").append(contextPath).
append("/combined.css?id=").
append(ld.scriptId)
.append("\" ");
@@ -366,6 +375,6 @@ public class CompressTagHandler {
private HashSet getCssDuplicatesHash(IRequestProxy request) {
return (HashSet<String>) request.getAttribute(CSS_DUPLICATES);
}
private static final Logger logger = LoggerFactory.getLogger(CompressTagHandler.class);
}