2009/7/28 Nicolaas Matthijs <[email protected]>: > I know that Sling allows me to associate a (ruby, python, esp, ...) script > with a certain Resource Type. > > However, I would like to do something slightly different. Let's say I've > created a script at: > > /some/folder/examplescript.py > > I now want to be able to hit that URL directly and have Sling execute that > script for me, instead of downloading the source code of that script (which > seems to be the default behavior). > > I've also found this e-mail thread from quite a while ago: > > http://markmail.org/message/dyyfelg7vnwghnbh > > This suggests to me that it is a desired feature of Sling to do this and also > mentions a possible solution for the problem. However, when I try to go here: > > /some/folder/examplescript.py.html > > nothing happens. > > > So my question is: does Sling still support direct script execution and if > so, how should I use it?
Hi Nicolas, Did you also see the thread at [1], and especially the servlet Felix suggests? In short, you should be able to write a servlet and register it for a specific extension (e.g. "run"). The servlet would take care of running the script file. You would then be able to execute your script by requesting /some/folder/examplescript.py.html.run [1] http://markmail.org/thread/suagknqfi4rtrg5z -- Vidar S. Ramdal <[email protected]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
