After thinking a bit about it, I think that neither renaming server- side scripts to ecma nor having a designated /apps or /libs path nor having an executable bit would solve my problem in the light of Bunkai, where you actually want to edit the scripts you are going to execute later.

I do not really understand yet when scripts are supposed to be executed on request and where this behavior is desired (it feels a bit like PHP to me)

regards,

Lars

On 20.02.2008, at 15:37, Felix Meschberger wrote:

Hi,

Am Mittwoch, den 20.02.2008, 14:33 +0100 schrieb Lars Trieloff:
I was unable to get the JSON representation (curl -u admin:admin 
http://localhost:8888/dojo/dojo/AdapterRegistry.js.1.json)
 because Sling tries to execute the JS script then and gives me
following error message:

org.mozilla.javascript.EcmaError: ReferenceError: "dojo" is not
defined. (/dojo/dojo/AdapterRegistry.js#1) ... and so on.

Yes, we execute a resource, which adapts to Servlet, if the request has
an extension. Therefore the request /dojo/dojo/AdapterRegistry.js (no
extension) is not executed by the given request is executed (extension
json).

This collision between streaming the script and executing the script is
an issue only with .js files AFAIK. The reason for this is, that the
JavaScript ScriptEngineFactory is registered for .js and .esp files.

We might fix this by using .ecma instead of .js for server-side
JavaScript files.

WDYT ?


So my question is how do I define subtrees that are not executable,
even if they contain a script. I think microsling originally had a
convention that only scripts in /scripts were actually executable, but
the current code deviates from this convention.

This depends from where you are looking from: I would say, microsling
devaiated from Sling in that respect ;-)

Regards
Felix


--
Lars Trieloff
[EMAIL PROTECTED]
http://weblogs.goshaky.com/weblogs/lars

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to