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

Reply via email to