This is an automated email from the ASF dual-hosted git repository.

thiagohp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git


The following commit(s) were added to refs/heads/master by this push:
     new 101d388fc TAP5-2810: fixing EsSihmDispatcher when context path isn't /
101d388fc is described below

commit 101d388fc4fd07cc2c7e7a02ad16569819718d94
Author: Thiago H. de Paula Figueiredo <[email protected]>
AuthorDate: Sat Jul 4 17:59:21 2026 -0300

    TAP5-2810: fixing EsSihmDispatcher when context path isn't /
---
 .../internal/services/ajax/EsShimManagerImpl.java       | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/EsShimManagerImpl.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/EsShimManagerImpl.java
index 4aa087b3b..cf195e30c 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/EsShimManagerImpl.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/EsShimManagerImpl.java
@@ -41,6 +41,8 @@ public class EsShimManagerImpl implements EsShimManager
     
     private final String uncompressedRequestPrefix;
     
+    private final String urlPrefix;
+    
     public EsShimManagerImpl(Map<String, Resource> shims,
             PathConstructor pathConstructor,
             BaseURLSource baseURLSource,
@@ -54,8 +56,9 @@ public class EsShimManagerImpl implements EsShimManager
         this.pathConstructor = pathConstructor;
         this.baseURLSource = baseURLSource;
         this.request = request;
-        this.compressedRequestPrefix = getRequestPrefixUncached(true);
-        this.uncompressedRequestPrefix = getRequestPrefixUncached(false);
+        this.compressedRequestPrefix = getRequestPrefixUncached(true, false);
+        this.uncompressedRequestPrefix = getRequestPrefixUncached(false, 
false);
+        this.urlPrefix = getRequestPrefixUncached(true, true);
     }
 
     /**
@@ -69,20 +72,22 @@ public class EsShimManagerImpl implements EsShimManager
     }
     
     @Override
-    public String getRequestPrefix(boolean compress) 
+    public String getDispatcherUrlPrefix(boolean compress) 
     {
         return compress ? compressedRequestPrefix : uncompressedRequestPrefix;
     }
     
-    public String getRequestPrefixUncached(boolean compress)
+    public String getRequestPrefixUncached(boolean compress, boolean 
clientPath)
     {
-        return pathConstructor.constructDispatchPath(assetPrefix, (compress ? 
ES_SUBPATH + ".gz" : ES_SUBPATH)) + "/";
+        final String suffix = compress ? ES_SUBPATH + ".gz" : ES_SUBPATH;
+        return (clientPath ? pathConstructor.constructClientPath(assetPrefix, 
suffix) : 
+                pathConstructor.constructDispatchPath(assetPrefix, suffix)) + 
"/";
     }
 
     @Override
     public String getUrl(String moduleName) {
         return baseURLSource.getBaseURL(request.isSecure()) + 
-                getRequestPrefix(true) + moduleName + ".js";
+                urlPrefix + moduleName + ".js";
     }
     
 }

Reply via email to