This is an automated email from the ASF dual-hosted git repository.
pauls pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-core.git
The following commit(s) were added to refs/heads/master by this push:
new c190f39 SLING-9406 - Add bundled script support to the servlets
resolver
c190f39 is described below
commit c190f391dac4a0f2f25a976a8acb8fe18ed5411f
Author: Karl Pauls <[email protected]>
AuthorDate: Wed May 20 00:20:01 2020 +0200
SLING-9406 - Add bundled script support to the servlets resolver
* use the path of the executable as a filename
---
.../sling/scripting/core/impl/bundled/ScriptContextProvider.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/src/main/java/org/apache/sling/scripting/core/impl/bundled/ScriptContextProvider.java
b/src/main/java/org/apache/sling/scripting/core/impl/bundled/ScriptContextProvider.java
index ac5e6da..47cba4e 100644
---
a/src/main/java/org/apache/sling/scripting/core/impl/bundled/ScriptContextProvider.java
+++
b/src/main/java/org/apache/sling/scripting/core/impl/bundled/ScriptContextProvider.java
@@ -97,8 +97,8 @@ public class ScriptContextProvider {
bindings.put(SlingBindings.LOG, scriptLogger);
bindings.put(SlingBindings.SLING, new
ScriptHelper(executable.getBundleContext(), new
SlingScriptAdapter(scriptingResourceResolverProvider.getRequestScopedResourceResolver(),
executable.getPath(), "sling/bundle/resource"), request, response));
bindings.put(BundledRenderUnit.VARIABLE, executable);
- bindings.put(ScriptEngine.FILENAME, executable.getName());
- bindings.put(ScriptEngine.FILENAME.replaceAll("\\.", "_"),
executable.getName());
+ bindings.put(ScriptEngine.FILENAME, executable.getPath());
+ bindings.put(ScriptEngine.FILENAME.replaceAll("\\.", "_"),
executable.getPath());
ProtectedBindings protectedBindings = new ProtectedBindings(bindings,
PROTECTED_BINDINGS);
for (BindingsValuesProvider bindingsValuesProvider :
bvpTracker.getBindingsValuesProviders(scriptEngine.getFactory(),