This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git
commit bc49398f1d7d29c8097145a7cb8c37f95586f7f6 Author: Bertrand Delacretaz <[email protected]> AuthorDate: Tue Nov 18 13:54:41 2008 +0000 SLING-619 - add README.txt with info on how to test this bundle git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/java@718587 13f79535-47bb-0310-9956-ffa450edef68 --- README.txt | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..985f318 --- /dev/null +++ b/README.txt @@ -0,0 +1,39 @@ +Sling scripting.java module +--------------------------- + +This module implements a script engine for java servlets, that are compiled +on the fly by Sling. + +To test it: + +1. Install this bundle in Sling, for example with + + mvn -P autoInstallBundle clean install -Dsling.url=http://localhost:8888/system/console + +If Sling is running with the launchpad/testing setup. + +2. Create /apps/foo/foo.java in your repository (via WebDAV for example), with this code: + +package apps.foo; + +import java.io.IOException; +import javax.servlet.ServletException; +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.SlingHttpServletResponse; +import org.apache.sling.api.servlets.SlingSafeMethodsServlet; + +public class foo extends SlingSafeMethodsServlet { + + protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/plain"); + response.getWriter().write("Response from " + getClass().getName() + " at " + new java.util.Date()); + } +} + +3. Request http://localhost:8888/content/foo/*.html which should display something like + + Response from apps.foo.foo at Tue Nov 18 14:49:14 CET 2008 + +4. The servlet code should be automatically recompiled after any changes. + \ No newline at end of file -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
