You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Padraic Hannon (JIRA)" <ji...@apache.org> on 2007/11/26 20:00:43 UTC
[jira] Commented: (SLING-110) Update Script System to be JSR-223
Compatible
[ https://issues.apache.org/jira/browse/SLING-110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12545550 ]
Padraic Hannon commented on SLING-110:
--------------------------------------
Currently I have a version which looks ok using the BSF 3.0-SNAPSHOT. However, I still have a custom SlingScriptEngine interface which I would like to get rid of. Also, I still have SlingScript having a getScriptEngine() method which I would like to remove. One thing I do not like about BSF and JSR-223 is that the eval returns an object. I would much rather eval to a writer and not load a string into memory just to flush out the wire.
> Update Script System to be JSR-223 Compatible
> ----------------------------------------------
>
> Key: SLING-110
> URL: https://issues.apache.org/jira/browse/SLING-110
> Project: Sling
> Issue Type: Improvement
> Components: microsling, Scripting
> Affects Versions: 2.0.0
> Reporter: Padraic Hannon
>
> Currently sling and microsling use a custom scripting framework. This framework should be updated to be jsr-223 compatible.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
Re: [jira] Commented: (SLING-110) Update Script System to be
JSR-223 Compatible
Posted by Felix Meschberger <fm...@gmail.com>.
Hi,
Thanks alot for this. I will shortly look into the patch.
However, here are some first remarks:
Am Montag, den 26.11.2007, 11:00 -0800 schrieb Padraic Hannon (JIRA):
> Padraic Hannon commented on SLING-110:
> --------------------------------------
>
> Currently I have a version which looks ok using the BSF 3.0-SNAPSHOT.
> However, I still have a custom SlingScriptEngine interface which I would like to get rid of.
+1
If we are going to using Java Scripting, SlingScriptEngine interface is
not needed anymore and should be dropped.
> Also, I still have SlingScript having a getScriptEngine() method which I would like to remove.
+1
If there is no SlingScriptEngine anymore, there is no getScriptEngine. I
suggest, we add a method eval(Map<String, Object> props) which then
calls into Java Scripting to evaluate the script and use the props as
bound variables. This way, sling/microsling just calls Script.eval to
call the script.
WDYT ?
> One thing I do not like about BSF and JSR-223 is that the eval returns an object. I would much
> rather eval to a writer and not load a string into memory just to flush out the wire.
Java Scripting is generic in that scripts may be used to calculate
results. As such there must be the possibility to return a value.
Generally we might want to ignore this value.
The writer to be used by scripts for sending back the response is
available as the "out" property in props.
Hope this helps.
Regards
Felix