> Maybe an interface like this (to be expanded with more useful
> functions) would be good?
>
> public interface SlingScriptHelpers {
> /** Include the resource pointed to by the given path in the
> current response */
> void include(String relativeOrAbsolutePath) throws IOException,
> ServletException;
> }
>
> And this would be made available to scripts as a variable named "sling".
>
> I haven't looked in detail at the existing Sling stuff, so we might
> need more than that?
> (keeping in mind the minimalism of microsling)
the j2ee equivalent would be:
req.getRequestDispatcher(path).include(req, resp);
right? so i think this very same mechanism should also be available
for the scripts.
we need to define how the j2ee context is exposed to the script.
for example, i would expect that in esp, there would be 'document' or
'context' field exposed.
for example:
document.write(...) would write to the response writer
and
response.setContentType(...) would set the response content type
so:
request.getRequestDispatcher(...).include(reqest, response) should
actually work.
but of course, a convenience class should encapsulate this in order to
make microsling easy to use. either:
sling.include(...)
document.include(...)
response.include(...)
regards, toby
--
-----------------------------------------< [EMAIL PROTECTED] >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---