hi,
I was also looking for some documentation re ESP, thanks for the
pointers. I have put a demo ESP file in the wiki:
http://cwiki.apache.org/confluence/display/SLING/Scripting+variables
HTH, Renaud
[EMAIL PROTECTED] schrieb:
Hi,
I've been looking for the Sling ESP reference documentation, but
google was not really helpful in this. Can somebody point to some doc?
To complement Bertrand's post:
ESP is much like JSP but using JavaScript (Rhino implementation)
instead of Java as the scripting language.
As such by default an ESP is in script mode, that is everything is
written to the response as is. The following constructs are available:
<%= expr %>: Evaluates the expression expr and prints the result <%
javascript %>: Runs the javascript code <%-- comment -->: ESP comment
removed while preprocessing the script
Just like with JSP, ESP scripts are converted into plain JavaScript
code on the run, that is a construct like
<% for (var i in list) { %> <p><%= i %>: <%= list[i] %></p> <% } %>
is converted to
for (var i in list) { out.print("\n"); out.print("<p>"); out.print(i);
out.print(": "); out.print("list[i]"); out.print("</p>\n"); }
(Note I split the line in the loop for readability).
Hope this helps.
Regards Felix
Thanks, Juerg