Author: bdelacretaz Date: Tue Nov 18 05:54:41 2008 New Revision: 718587 URL: http://svn.apache.org/viewvc?rev=718587&view=rev Log: SLING-619 - add README.txt with info on how to test this bundle
Added: incubator/sling/trunk/scripting/java/README.txt (with props) Added: incubator/sling/trunk/scripting/java/README.txt URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/java/README.txt?rev=718587&view=auto ============================================================================== --- incubator/sling/trunk/scripting/java/README.txt (added) +++ incubator/sling/trunk/scripting/java/README.txt Tue Nov 18 05:54:41 2008 @@ -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 Propchange: incubator/sling/trunk/scripting/java/README.txt ------------------------------------------------------------------------------ svn:eol-style = native