blob: e7d5590b330ee800987365b30adc28c475afa308 [file] [log] [blame]
Sling javashell sample
javashell lets user execute arbitrary code with NO LIMITS, and
is only meant as a teaching/demo tool. Use at your own risk, or
do not use if you don't understand the issues.
Just try "System.exit(0)" if you don't know what this means ;-)
This sample application executes java code entered in an HTML form,
by generating and compiling java servlets on the fly.
Launch Sling
The Sling Container can be launched by running the following command in the
launchpad/builder/target directory:
java -jar<version>-standalone.jar
so if the current version is 7, the command should be:
java -jar
To run this demo the following bundle must be installed:
Install it as follows:
contrib/scripting/java $ mvn install -P autoInstallBundle
Run this sample
Build and install the sample bundle by running
$ mvn install -P autoInstallBundle
1. Log in by navigating to:
using admin/admin as credentials.
2. Navigate to:
That page should include a "Result of execution" section which lists
some properties and child nodes. This section is generated by the
javashell script.
If you get the default HTML rendering under the "Result of execution"
header, the bundle is probably not active.
3. The above page includes links to edit the java code, and create new
pages with more code to execute.
The servlets are generated under /apps/javashell/servlets, and are *not*
cleaned up currently, this is something that should be improved.