You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2017/06/19 12:41:52 UTC

[46/53] sling-site git commit: asf-site branch created for published content

http://git-wip-us.apache.org/repos/asf/sling-site/blob/a6129baf/documentation/bundles/scheduler-service-commons-scheduler.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/scheduler-service-commons-scheduler.html b/documentation/bundles/scheduler-service-commons-scheduler.html
new file mode 100644
index 0000000..b7a4f3c
--- /dev/null
+++ b/documentation/bundles/scheduler-service-commons-scheduler.html
@@ -0,0 +1,91 @@
+<!DOCTYPE html><html lang="en">
+    <head>
+<meta charset="utf-8"/>
+        <title>Apache Sling on JBake</title>
+        <link rel="stylesheet" href="/res/css/site.css"/>
+        <link rel="stylesheet" href="/res/css/codehilite.css"/>
+        <div class="title">
+            <div class="logo">
+                <a href="http://sling.apache.org">
+                    <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/>
+                </a>
+            </div><div class="header">
+                <a href="http://www.apache.org">
+                    <img border="0" alt="Apache" src="/res/logos/apache.png"/>
+                </a>
+            </div>
+        </div>        
+    </head><body>
+<div class="menu">
+            <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h
 ref="/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/contributing.html">Contributing</a><br/><a href="/news.html">News</a><br/><a href="/links.html">Links</a><br/><a href="/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a><br/><a href="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun
 dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong>
+        </div>        <div class="main">
+<div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>Scheduler Service (commons scheduler)</h1></header><p>The scheduler is a service for scheduling other services/jobs (it uses the open source Quartz library). The scheduler can be used in two ways, by registering the job through the scheduler API and by leveraging the whiteboard pattern that is supported by the scheduler. In most cases the whiteboard pattern is preferred</p>
+<div class="note">
+The notion of Job used in this context is a different one than the one used for <a href="/documentation/bundles/apache-sling-eventing-and-job-handling.html">Sling Jobs</a>. The main difference is that a scheduler's job is not persisted.
+</div>
+<h2>Examples of jobs that are scheduled by leveraging the whiteboard pattern</h2>
+<p>The following examples show you how to define and schedule a job by leveraging the whiteboard pattern.</p>
+<h3>Scheduling with a cron expression</h3>
+<p>The following job is executed every minute by setting <em>scheduler.expression</em> to the cron expression <em>"0 * * * * ?"</em>:</p>
+<p>package sling.docu.examples;</p>
+<p>import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Service; import org.apache.felix.scr.annotations.Property;</p>
+<p>@Component @Service(value = Runnable.class) @Property( name = "scheduler.expression", value = "0 * * * * ?") public class ScheduledCronJob implements Runnable {</p>
+<p>/** Default log. */ protected final Logger log = LoggerFactory.getLogger(this.getClass());</p>
+<p>public void run() { log.info("Executing a cron job (job#1) through the whiteboard pattern"); } // }</p>
+<h3>Scheduling at periodic times</h3>
+<p>The following job is executed every ten seconds by setting <em>scheduler.period</em> to <em>10</em>:</p>
+<p>package sling.docu.examples;</p>
+<p>import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Service; import org.apache.felix.scr.annotations.Property;</p>
+<p>@Component @Service(value = Runnable.class) @Property( name = "scheduler.period", longValue = 10) public class ScheduledPeriodicJob implements Runnable {</p>
+<p>/** Default log. */ protected final Logger log = LoggerFactory.getLogger(this.getClass());</p>
+<p>public void run() { log.info("Executing a perodic job (job#2) through the whiteboard pattern"); } // }</p>
+<h3>Preventing concurrent execution</h3>
+<p>By default, jobs can be concurrently executed. To prevent this, set the <em>scheduler.concurrent</em> property to <em>false</em>:</p>
+<p>@Property(name="scheduler.concurrent", boolValue=false)</p>
+<h3>Scheduling the job just once in a cluster</h3>
+<p>If the same code/same services is executed on multiple nodes within a cluster, the same job might be scheduled on each instance. If this is not desired, the job can either be bound to the leader of the topology or a single instance (which one this is, is not further defined):</p>
+<p>@Property(name="scheduler.runOn", value="LEADER");</p>
+<p>or</p>
+<p>@Property(name="scheduler.runOn", value="SINGLE");</p>
+<p>Since in contrast to <a href="/documentation/bundles/apache-sling-eventing-and-job-handling.html">Sling Jobs</a> the scheduler queue is only held in memory, there will be no distribution of jobs. So if job '1' was scheduled on instance 'a' with the option to run on the leader only, but the leader is instance 'b', which hasn't the job in the queue, the job will never be executed by any instance!</p>
+<h2>The Scheduler API</h2>
+<p>The scheduler has methods to execute jobs periodically, based on a cron expression or at a given time. For more details please refer to the <a href="http://sling.apache.org/apidocs/sling6/org/apache/sling/commons/scheduler/Scheduler.html">javadocs</a>.</p>
+<h2>Examples of scheduled jobs registered through the scheduler API</h2>
+<p>The following examples show you how to define and schedule a job that is registered through the scheduler api.</p>
+<h3>Defining the job</h3>
+<p>The following code sample defines a <em>job</em> object that writes a message in the logs:</p>
+<p>final Runnable job = new Runnable() { public void run() { log.info("Executing the job"); } };</p>
+<h3>Scheduling with a cron expression</h3>
+<p>To execute the job as defined above at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday, you can use the <em>addJob()</em> method with the following parameters:</p>
+<p>String schedulingExpression = "0 15 10 ? * MON-FRI"; this.scheduler.addJob("myJob", job, null, schedulingExpression, true);</p>
+<p>Refer to http://www.docjar.com/docs/api/org/quartz/CronTrigger.html to define more scheduling expressions.</p>
+<h3>Scheduling at periodic times</h3>
+<p>To execute the job as defined above every 3 minutes (180 seconds), you can use the <em>addPeriodicJob()</em> method with the following parameters:</p>
+<p>long period = 3*60; //the period is expressed in seconds this.scheduler.addPeriodicJob("myJob", job, null, period, true);</p>
+<h3>Scheduling at a given time</h3>
+<p>To execute the job as defined above at a specific date (on January 10th 2020), you can use the <em>fireJobAt()</em> method with the following parameters:</p>
+<p>SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd"); String date = "2020/01/10"; java.util.Date fireDate = formatter.parse(date); this.scheduler.fireJobAt("myJob", job, null, fireDate);</p>
+<h3>A service scheduling the job based on 3 different kinds of scheduling</h3>
+<p>The code implementing a service that simultaneously executes the job based on 3 different kinds of scheduling can look as follows:</p>
+<p>package sling.docu.examples;</p>
+<p>import java.io.Serializable; import java.util.Date; import java.util.HashMap; import java.util.Map;</p>
+<p>import org.apache.sling.commons.scheduler.Scheduler; import org.osgi.service.component.ComponentContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Reference;</p>
+<p>/** * This service executes scheduled jobs * */ @Component public class HelloWorldScheduledService {</p>
+<p>/** Default log. */ protected final Logger log = LoggerFactory.getLogger(this.getClass());</p>
+<p>/** The scheduler for rescheduling jobs. */ @Reference private Scheduler scheduler;</p>
+<p>protected void activate(ComponentContext componentContext) throws Exception { //case 1: with addJob() method: executes the job every minute String schedulingExpression = "0 * * * * ?"; String jobName1 = "case1"; Map&lt;String, Serializable&gt; config1 = new HashMap&lt;String, Serializable&gt;(); boolean canRunConcurrently = true; final Runnable job1 = new Runnable() { public void run() { log.info("Executing job1"); } }; try { this.scheduler.addJob(jobName1, job1, config1, schedulingExpression, canRunConcurrently); } catch (Exception e) { job1.run(); }</p>
+<p>//case 2: with addPeriodicJob(): executes the job every 3 minutes String jobName2 = "case2"; long period = 180; Map&lt;String, Serializable&gt; config2 = new HashMap&lt;String, Serializable&gt;(); final Runnable job2 = new Runnable() { public void run() { log.info("Executing job2"); } }; try { this.scheduler.addPeriodicJob(jobName2, job2, config2, period, canRunConcurrently); } catch (Exception e) { job2.run(); }</p>
+<p>//case 3: with fireJobAt(): executes the job at a specific date (date of deployment + delay of 30 seconds) String jobName3 = "case3"; final long delay = 30*1000; final Date fireDate = new Date(); fireDate.setTime(System.currentTimeMillis() + delay); Map&lt;String, Serializable&gt; config3 = new HashMap&lt;String, Serializable&gt;(); final Runnable job3 = new Runnable() { public void run() { log.info("Executing job3 at date: {} with a delay of: {} seconds", fireDate, delay/1000); } }; try { this.scheduler.fireJobAt(jobName3, job3, config3, fireDate); } catch (Exception e) { job3.run(); } }</p>
+<p>protected void deactivate(ComponentContext componentContext) { log.info("Deactivated, goodbye!"); }</p>
+<p>}</p></section></div></div>            
+<div class="footer">
+                <div class="timestamp">
+                    TODO display revision number here
+                </div><div class="trademarkFooter">
+                    Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
+                </div>
+            </div>            
+            
+        </div>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/sling-site/blob/a6129baf/documentation/bundles/scripting.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/scripting.html b/documentation/bundles/scripting.html
new file mode 100644
index 0000000..ef99cd5
--- /dev/null
+++ b/documentation/bundles/scripting.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html><html lang="en">
+    <head>
+<meta charset="utf-8"/>
+        <title>Apache Sling on JBake</title>
+        <link rel="stylesheet" href="/res/css/site.css"/>
+        <link rel="stylesheet" href="/res/css/codehilite.css"/>
+        <div class="title">
+            <div class="logo">
+                <a href="http://sling.apache.org">
+                    <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/>
+                </a>
+            </div><div class="header">
+                <a href="http://www.apache.org">
+                    <img border="0" alt="Apache" src="/res/logos/apache.png"/>
+                </a>
+            </div>
+        </div>        
+    </head><body>
+<div class="menu">
+            <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h
 ref="/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/contributing.html">Contributing</a><br/><a href="/news.html">News</a><br/><a href="/links.html">Links</a><br/><a href="/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a><br/><a href="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun
 dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong>
+        </div>        <div class="main">
+<div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>Sling Scripting</h1></header><p>[TOC]</p>
+<p>Sling Scripting allows the easy development and usage of different scripting (aka templating) engines.</p>
+<h1>Sling Scripting Engines</h1>
+<ul>
+  <li>Freemarker *</li>
+  <li>Groovy *</li>
+  <li><a href="/documentation/bundles/scripting/scripting-htl.html">HTL</a></li>
+  <li>Java *</li>
+  <li>Javascript</li>
+  <li><a href="/documentation/bundles/scripting/scripting-jsp.html">JSP</a></li>
+  <li>JST *</li>
+  <li>Python *</li>
+  <li>Ruby *</li>
+  <li>Scala *</li>
+  <li><a href="/documentation/bundles/scripting/scripting-thymeleaf.html">Thymeleaf</a> *</li>
+  <li>Velocity *</li>
+  <li>XProc *</li>
+  <li>
+  <p>in contrib</p></li>
+</ul></section></div></div>            
+<div class="footer">
+                <div class="timestamp">
+                    TODO display revision number here
+                </div><div class="trademarkFooter">
+                    Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
+                </div>
+            </div>            
+            
+        </div>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/sling-site/blob/a6129baf/documentation/bundles/scripting/scripting-htl.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/scripting/scripting-htl.html b/documentation/bundles/scripting/scripting-htl.html
new file mode 100644
index 0000000..69e988f
--- /dev/null
+++ b/documentation/bundles/scripting/scripting-htl.html
@@ -0,0 +1,265 @@
+<!DOCTYPE html><html lang="en">
+    <head>
+<meta charset="utf-8"/>
+        <title>Apache Sling on JBake</title>
+        <link rel="stylesheet" href="/res/css/site.css"/>
+        <link rel="stylesheet" href="/res/css/codehilite.css"/>
+        <div class="title">
+            <div class="logo">
+                <a href="http://sling.apache.org">
+                    <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/>
+                </a>
+            </div><div class="header">
+                <a href="http://www.apache.org">
+                    <img border="0" alt="Apache" src="/res/logos/apache.png"/>
+                </a>
+            </div>
+        </div>        
+    </head><body>
+<div class="menu">
+            <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h
 ref="/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/contributing.html">Contributing</a><br/><a href="/news.html">News</a><br/><a href="/links.html">Links</a><br/><a href="/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a><br/><a href="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun
 dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong>
+        </div>        <div class="main">
+<div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>HTL Scripting Engine</h1></header><p>The Apache Sling HTL Scripting Engine, <a href="https://issues.apache.org/jira/browse/SLING-6028">formerly known as Sightly</a>, is the reference implementation of the <a href="https://github.com/Adobe-Marketing-Cloud/htl-spec">HTML Template Language</a>.</p>
+<p>[TOC]</p>
+<h1>Modules</h1>
+<p>The Sling implementation is comprised of the following modules:</p>
+<ol>
+  <li><a href="https://github.com/apache/sling/tree/trunk/bundles/scripting/sightly/compiler"><code>org.apache.sling.scripting.sightly.compiler</code></a> - provides support for compiling HTML Template Language scripts into an Abstract Syntax Tree</li>
+  <li><a href="https://github.com/apache/sling/tree/trunk/bundles/scripting/sightly/java-compiler"><code>org.apache.sling.scripting.sightly.compiler.java</code></a> - provides support for transpiling the Abstract Syntax Tree produced by the <code>org.apache.sling.scripting.sightly.compiler</code> module into Java source code</li>
+  <li><a href="https://github.com/apache/sling/tree/trunk/bundles/scripting/sightly/engine"><code>org.apache.sling.scripting.sightly</code></a> - the HTL Scripting Engine bundle</li>
+  <li><a href="https://github.com/apache/sling/tree/trunk/bundles/scripting/sightly/js-use-provider"><code>org.apache.sling.scripting.sightly.js.provider</code></a> - the HTL JavaScript Use Provider, implementing support for the <code>use</code> JavaScript function</li>
+  <li><a href="https://github.com/apache/sling/tree/trunk/bundles/scripting/sightly/models-use-provider"><code>org.apache.sling.scripting.sightly.models.provider</code></a> - <a href="https://sling.apache.org/documentation/bundles/models.html">Sling Models</a> Use Provider</li>
+  <li><a href="https://github.com/apache/sling/tree/trunk/bundles/scripting/sightly/repl"><code>org.apache.sling.scripting.sightly.repl</code></a> - HTL Read-Eval-Print Loop Environment (REPL), useful for quickly prototyping scripts</li>
+  <li><a href="https://github.com/apache/sling/tree/trunk/tooling/maven/htl-maven-plugin"><code>htl-maven-plugin</code></a> - M2Eclipse compatible HTL Maven Plugin that provides support for validating HTML Template Language scripts from projects during build time</li>
+</ol>
+<h1>The Use-API</h1>
+<p>The <a href="https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/1.2/SPECIFICATION.md#4-use-api">HTML Template Language Specification</a> explicitly defines two ways of implementing support for business logic objects:</p>
+<ol>
+  <li>Java Use-API, through POJOs, that may optionally implement an <code>init</code> method:</li>
+</ol>
+<p>/** * Initialises the Use bean. * * @param bindings All bindings available to the HTL scripts. **/ public void init(javax.script.Bindings bindings);</p>
+<ol>
+  <li>JavaScript Use-API, by using a standardised use function</li>
+</ol>
+<p>/** * In the following example '/libs/dep1.js' and 'dep2.js' are optional * dependencies needed for this script's execution. Dependencies can * be specified using an absolute path or a relative path to this * script's own path. * * If no dependencies are needed the dependencies array can be omitted. */ use(['dep1.js', 'dep2.js'], function (Dep1, Dep2) { // implement processing</p>
+<p>// define this Use object's behaviour return { propertyName: propertyValue functionName: function () {} } });</p>
+<p>The HTL implementation from Sling provides the basic POJO support through the <a href="https://github.com/apache/sling/blob/trunk/bundles/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/pojo/Use.java"><code>org.apache.sling.scripting.sightly.pojo.Use</code></a> interface and the <a href="https://github.com/apache/sling/blob/trunk/bundles/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/JavaUseProvider.java"><code>JavaUseProvider</code></a>, whereas the <code>use</code> function is implemented by the <code>org.apache.sling.scripting.sightly.js.provider</code> bundle.</p>
+<p>However, the Sling implementation provides a few extensions to the Use-API.</p>
+<h2>Sling-specific Use-API Extensions</h2>
+<p>A full HTL installation provides the following Use Providers, in the order of their priority (the higher the service ranking value, the higher the priority):</p>
+<table>
+  <thead>
+    <tr>
+      <th>Service Ranking </th>
+      <th>Use Provider </th>
+      <th>Bundle </th>
+      <th>Functionality </th>
+      <th>Observations</th>
+    </tr>
+  </thead>
+  <tbody>
+    <tr>
+      <td>100</td>
+      <td><a href="https://github.com/apache/sling/blob/trunk/bundles/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/RenderUnitProvider.java"><code>RenderUnitProvider</code></a></td>
+      <td><code>org.apache.sling.scripting.sightly</code></td>
+      <td colspan="2">support for loading HTL templates through <code>data-sly-use</code></td>
+    </tr>
+    <tr>
+      <td>95</td>
+      <td><a href="https://github.com/apache/sling/blob/trunk/bundles/scripting/sightly/models-use-provider/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java"><code>SlingModelsUseProvider</code></a></td>
+      <td><code>org.apache.sling.scripting.sightly.models.provider</code></td>
+      <td colspan="2">support for loading <a href="https://sling.apache.org/documentation/bundles/models.html">Sling Models</a></td>
+    </tr>
+    <tr>
+      <td>90</td>
+      <td><a href="https://github.com/apache/sling/blob/trunk/bundles/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/JavaUseProvider.java"><code>JavaUseProvider</code></a></td>
+      <td><code>org.apache.sling.scripting.sightly</code></td>
+      <td>support for loading Java objects such as: <ol><li>OSGi services</li><li>POJOs adaptable from <code>SlingHttpServletRequest</code> or <code>Resource</code></li><li>POJOs that implement <code>Use</code></li></ol></td>
+      <td>The POJOs can be exported by bundles or can be backed by <code>Resources</code>. In the latter case the POJOs' package names should correspond to the backing resource's path; invalid Java characters which are valid path elements should be replaced by an underscore - <code>_</code>.</td>
+    </tr>
+    <tr>
+      <td>80</td>
+      <td><a href="https://github.com/apache/sling/blob/trunk/bundles/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/impl/JsUseProvider.java"><code>JsUseProvider</code></a></td>
+      <td><code>org.apache.sling.scripting.sightly.js.provider</code></td>
+      <td>support for loading objects defined through the JavaScript <code>use</code> function</td>
+      <td>The <code>org.apache.sling.scripting.sightly.js.provider</code> also provides a trimmed down <a href="https://github.com/apache/sling/tree/trunk/bundles/scripting/sightly/js-use-provider/src/main/resources/SLING-INF/libs/sling/sightly/js">asynchronous implementation</a> of the <code>Resource</code> API. However this was deprecated in <a href="https://issues.apache.org/jira/browse/SLING-4964">SLING-4964</a> (version 1.0.8 of the bundle) in favour of the synchronous API provided by the <code>org.apache.sling.scripting.javascript</code> bundle.</td>
+    </tr>
+    <tr>
+      <td>0 </td>
+      <td><a href="https://github.com/apache/sling/blob/trunk/bundles/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/ScriptUseProvider.java"><code>ScriptUseProvider</code></a></td>
+      <td><code>org.apache.sling.scripting.sightly</code></td>
+      <td colspan="2">support for loading objects returned by scripts interpreted by other Script Engines available on the platform</td>
+    </tr>
+  </tbody>
+</table>
+<p>The <code>service.ranking</code> value of each Use Provider is configurable, allowing for fine tuning of the order in which the providers are queried when <code>data-sly-use</code> is called. However, in order to not affect core functionality the <code>RenderUnitProvider</code> should always have the highest ranking. If you need to configure the providers' service ranking head over to the configuration console at <a href="http://localhost:8080/system/console/configMgr">http://localhost:8080/system/console/configMgr</a>.</p>
+<h3>Global Objects</h3>
+<p>The following global objects are available to all Use objects, either as a request attribute or as a property made available in the <code>javax.script.Bindings</code> map or attached to the <code>this</code> context of the <code>use</code> function:</p>
+<p>currentNode // javax.jcr.Node currentSession // javax.jcr.Session log // org.slf4j.Logger out // java.io.PrintWriter properties // org.apache.sling.api.resource.ValueMap reader // java.io.BufferedReader request // org.apache.sling.api.SlingHttpServletRequest resolver // org.apache.sling.api.resource.ResourceResolver resource // org.apache.sling.api.resource.Resource response // org.apache.sling.api.SlingHttpServletResponse sling // org.apache.sling.api.scripting.SlingScriptHelper</p>
+<h3>Sling Models Use Provider</h3>
+<p>Loading a Sling Model can be done with the following code:</p>
+<p>&lt;div data-sly-use.model3="org.example.models.Model3"&gt; ${model3.shine} </div></p>
+<p>Depending on the implementation the above code would either load the implementation with the highest service ranking of <code>Model3</code> if <code>org.example.models.Model3</code> is an interface, or would load the model <code>org.example.models.Model3</code> if this is a concrete implementation.</p>
+<p>It's important to note that this use provider will only load models that are adaptable from <code>SlingHttpServletRequest</code> or <code>Resource</code>.</p>
+<h4>Passing parameters</h4>
+<p>Passed parameters will be made available to the Sling Model as request attributes. Assuming the following markup:</p>
+<p>&lt;div data-sly-use.model3="${'org.example.models.Model3' @ colour='red', path=resource.path}"&gt; ${model3.shine} </div></p>
+<p>the model would retrieve the parameters using the following constructs:</p>
+<p>@Model(adaptables=SlingHttpServletRequest.class) public class Model3 {</p>
+<p>@Inject private String colour;</p>
+<p>@Inject private String path; }</p>
+<h3>Java Use Provider</h3>
+<p>The Java Use Provider can be used to load OSGi services, objects exported by bundles or backed by a <code>Resource</code>.</p>
+<h4>Resource-backed Java classes</h4>
+<p>When objects are backed by <code>Resources</code> the Java Use Provider will automatically handle the compilation of these classes. The classes' package names should correspond to the path of the backing resource, making sure to replace illegal Java characters with underscores - <code>_</code>.</p>
+<p><strong>Example:</strong> Assuming the following content structure:</p>
+<p>└── apps └── my-project └── components └── page ├── PageBean.java └── page.html</p>
+<p><code>page.html</code> could load <code>PageBean</code> either like:</p>
+<p>&lt;!DOCTYPE html&gt; &lt;html data-sly-use.page="apps.my_project.components.page.PageBean"&gt; ... </html></p>
+<p>or like:</p>
+<p>&lt;!DOCTYPE html&gt; &lt;html data-sly-use.page="PageBean"&gt; ... </html></p>
+<p>The advantage of loading a bean using just the simple class name (e.g. <code>data-sly-use.page=&quot;PageBean&quot;</code>) is that an inheriting component can overlay the <code>PageBean.java</code> file and provide a different logic. In this case the package name of the <code>PageBean</code> class will automatically be derived from the calling script's parent path (e.g. <code>apps.my_project.components.page</code>) - the bean doesn't even have to specify it. However, keep in mind that loading a bean this way is slower than providing the fully qualified class name, since the provider has to check if there is a backing resource. At the same time, loading an object using its fully qualified class name will not allow overriding it by inheriting components.</p>
+<h4>Passing parameters</h4>
+<p>Passed parameters will be made available to the Use object as request attributes and, if the object implements the <a href="https://github.com/apache/sling/blob/trunk/bundles/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/pojo/Use.java"><code>org.apache.sling.scripting.sightly.pojo.Use</code></a> interface, through the <code>javax.script.Bindings</code> passed to the <code>init</code> method. Assuming the following markup:</p>
+<p>&lt;div data-sly-use.useObject="${'org.example.use.MyUseObject' @ colour='red', year=2016}"&gt; ${useObject.shine} </div></p>
+<p>the object implementing <code>Use</code> would be able to retrieve the parameters using the following constructs:</p>
+<p>package org.example.use.MyUseObject;</p>
+<p>import javax.script.Bindings;</p>
+<p>import org.apache.sling.commons.osgi.PropertiesUtil; import org.apache.sling.scripting.sightly.pojo.Use;</p>
+<p>public class MyUseObject implements Use {</p>
+<p>private String colour; private Integer year;</p>
+<p>public void init(Bindings bindings) { colour = PropertiesUtil.toString(bindings.get("colour"), ""); year = PropertiesUtil.toInteger(bindings.get("year"), Calendar.getInstance().get(Calendar.YEAR)); } }</p>
+<p>or, if the object is adaptable from a <code>SlingHttpServletRequest</code>, through its <code>AdapterFactory</code>:</p>
+<p>package org.example.use;</p>
+<p>import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Properties; import org.apache.felix.scr.annotations.Property; import org.apache.felix.scr.annotations.Service; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.adapter.AdapterFactory;</p>
+<p>@Component @Service @Properties({ @Property( name = AdapterFactory.ADAPTABLE_CLASSES, value = { "org.apache.sling.api.SlingHttpServletRequest" } ), @Property( name = AdapterFactory.ADAPTER_CLASSES, value = { "org.example.use.MyUseObject" } ) }) public class RequestAdapterFactory implements AdapterFactory {</p>
+<p>@Override public <AdapterType> AdapterType getAdapter(Object adaptable, Class<AdapterType> type) { if (type == MyUseObject.class &amp;&amp; adaptable instanceof SlingHttpServletRequest) { SlingHttpServletRequest request = (SlingHttpServletRequest) adaptable; String colour = PropertiesUtil.toString(request.getAttribute("colour"), ""); Integer year = PropertiesUtil.toInteger(request.getAttribute("year"), Calendar.getInstance().get(Calendar.YEAR)); /* * for the sake of this example we assume that MyUseObject has this constructor */ return (AdapterType) new MyUseObject(colour, year); } return null; } }</p>
+<h3>JavaScript Use Provider</h3>
+<p>The JavaScript Use Provider allows loading objects created through the <code>use</code> function, by evaluating scripts passed to <code>data-sly-use</code>. The JavaScript files are evaluated server-side by the <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino">Rhino</a> scripting engine, through the <code>org.apache.sling.scripting.javascript</code> implementation bundle. This allows you to mix JavaScript API with the Java API exported by the platform. For more details about how you can access Java APIs from within JavaScript please check the <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Scripting_Java#Accessing_Java_Packages_and_Classes">Rhino Java Scripting guide</a>.</p>
+<p><strong>Example:</strong> Assuming the following content structure:</p>
+<p>└── apps └── my-project └── components └── page ├── page.html └── page.js</p>
+<p><code>page.html</code> could load <code>page.js</code> either like:</p>
+<p>&lt;!DOCTYPE html&gt; &lt;html data-sly-use.page="/apps/my-project/components/page/page.js"&gt; ... </html></p>
+<p>or like:</p>
+<p>&lt;!DOCTYPE html&gt; &lt;html data-sly-use.page="page.js"&gt; ... </html></p>
+<p>Similar to the Java Use Provider, loading the script using a relative path allows inheriting components to overlay just the Use script, without having to also overlay the calling HTL script.</p>
+<h4>Global Objects</h4>
+<p>Besides the global objects available to all Use Providers, the JavaScript Use Provider also provides the following global objects available in the context of the <code>use</code> function:</p>
+<p>console // basic wrapper on top of log, but without formatting / throwable support exports // basic Java implementation of CommonJS - http://requirejs.org/docs/commonjs.html module // basic Java implementation of CommonJS - http://requirejs.org/docs/commonjs.html setImmediate // Java implementation of the Node.js setImmediate function setTimeout // Java implementation of the Node.js setTimeout function sightly // the namespace object under which the asynchronous Resource-API implemented by // org.apache.sling.scripting.sightly.js.provider is made available to consumers use // the use function</p>
+<p>With the exception of the <code>console</code> and <code>use</code> objects, all the other global objects implemented by the JavaScript Use Provider are present in order to support the asynchronous Resource-API implemented by <code>org.apache.sling.scripting.sightly.js.provider</code>. However, this was deprecated starting with version 1.0.8 - see <a href="https://issues.apache.org/jira/browse/SLING-4964">SLING-4964</a>.</p>
+<h4>Passing parameters</h4>
+<p>Passed parameters will be made available to the Use object as properties of <code>this</code>. Assuming the following markup:</p>
+<p>&lt;div data-sly-use.logic="${'logic.js' @ colour='red', year=2017}"&gt; My colour is ${logic.colour ? logic.colour : 'not important'} and I'm from ${logic.year} </div></p>
+<p>the object would be able to access the parameters like:</p>
+<p>use(function() { 'use strict';</p>
+<p>var colour = this.colour || ''; var year = this.year || new Date().getFullYear();</p>
+<p>return { colour: colour, year: year } });</p>
+<h4>Caveats</h4>
+<p>Since these scripts are evaluated server-side, by compiling JavaScript to Java, you need to pay attention when comparing primitive objects using the strict equal operator (<code>===</code>) since comparisons between JavaScript and Java objects with the same apparent value will return <code>false</code> (this also applies to the strict not-equal operator - <code>!==</code>).</p>
+<p>Assuming the following HTL script:</p>
+<p>&lt;ol data-sly-use.obj="logic.js" data-sly-list="${obj}"&gt; <li> Code <code>${item.code}</code> evaluates to <code>${item.result}</code> </li> </ol></p>
+<p>and the following JavaScript file:</p>
+<p>use(function() {</p>
+<p>return [ { code: 'new java.lang.String("apples") === "apples"', result: new java.lang.String("apples") === "apples" }, { code: 'new java.lang.String("apples") == "apples"', result: new java.lang.String("apples") == "apples" }, { code: 'new java.lang.String("apples") !== "apples"', result: new java.lang.String("apples") !== "apples" }, { code: 'new java.lang.String("apples") != "apples"', result: new java.lang.String("apples") != "apples" }, { code: 'new java.lang.Integer(1) === 1', result: new java.lang.Integer(1) === 1 }, { code: 'new java.lang.Integer(1) == 1', result: new java.lang.Integer(1) == 1 }, { code: 'new java.lang.Integer(1) !== 1', result: new java.lang.Integer(1) !== 1 }, { code: 'new java.lang.Integer(1) != 1', result: new java.lang.Integer(1) != 1 }, { code: 'java.lang.Boolean.TRUE === true', result: java.lang.Boolean.TRUE === true }, { code: 'java.lang.Boolean.TRUE == true', result: java.lang.Boolean.TRUE == true }, { code: 'java.lang.Boolean.TRUE !== true', resu
 lt: java.lang.Boolean.TRUE !== true }, { code: 'java.lang.Boolean.TRUE != true', result: java.lang.Boolean.TRUE != true } ]; });</p>
+<p>the output would be:</p>
+<ol>
+  <li>Code new java.lang.String("apples") === "apples" evaluates to false</li>
+  <li>Code new java.lang.String("apples") == "apples" evaluates to true</li>
+  <li>Code new java.lang.String("apples") !== "apples" evaluates to true</li>
+  <li>Code new java.lang.String("apples") != "apples" evaluates to false</li>
+  <li>Code new java.lang.Integer(1) === 1 evaluates to false</li>
+  <li>Code new java.lang.Integer(1) == 1 evaluates to true</li>
+  <li>Code new java.lang.Integer(1) !== 1 evaluates to true</li>
+  <li>Code new java.lang.Integer(1) != 1 evaluates to false</li>
+  <li>Code java.lang.Boolean.TRUE === true evaluates to false</li>
+  <li>Code java.lang.Boolean.TRUE == true evaluates to true</li>
+  <li>Code java.lang.Boolean.TRUE !== true evaluates to true</li>
+  <li>Code java.lang.Boolean.TRUE != true evaluates to false</li>
+</ol>
+<p>Evaluations of Java objects in JavaScript constructs where the operand is automatically type coerced will work, but Rhino might complain about the Java objects not correctly calling the Rhino helper function <code>Context.javaToJS()</code>. In order to avoid these warnings it's better to explicitly perform your comparisons like in the following example:</p>
+<p>if (myObject) { ... } // should be replaced by if (myObject != null) { ... }</p>
+<p>myObject ? 'this' : 'that' //should be replaced by myObject != null ? 'this' : 'that'</p>
+<h3>Script Use Provider</h3>
+<p>The Script Use Provider allows loading objects evaluated by other script engines available on the platform. The same loading considerations as for the Java and JavaScript Use Providers apply.</p>
+<h3>Picking the best Use Provider for a project</h3>
+<p>The following table summarises the pros and cons for each Use Provider, with the obvious exception of the Render Unit Use Provider.</p>
+<table>
+<tr>
+<th>Use Provider</th>
+<th>Advantages</th>
+<th>Disadvantages</th>
+</tr>
+<tr>
+<td>Sling Models Use Provider</td>
+<td><ul><li>convenient injection annotations for data retrieval</li><li>easy to extend from other Sling Models</li><li>simple setup for unit testing</li></ul></td>
+<td><ul><li>lacks flexibility in terms of component overlaying, relying on <code>service.ranking</code> configurations; this was solved for Sling Models 1.3.0 by <a href="https://issues.apache.org/jira/browse/SLING-5992">SLING-5992</a></li></ul></td>
+</tr>
+<tr>
+<td>Java Use Provider</td>
+<td>
+<p>Use-objects provided through bundles:</p>
+<ul>
+<li>faster to initialise and execute than Sling Models for similar code</li>
+<li>easy to extend from other similar Use-objects</li>
+<li>simple setup for unit testing</li>
+</ul>
+<p>Use-objects backed by <code>Resources</code>:</p>
+<ul>
+<li>faster to initialise and execute than Sling Models for similar code</li>
+<li>easy to override from inheriting components through search path overlay or by using the <code>sling:resourceSuperType</code> property, allowing for greater flexibility</li>
+<li>business logic for components sits next to the HTL scripts where the objects are used</li>
+</ul>
+</td>
+<td>
+<p>Use-objects provided through bundles:</p>
+<ul>
+<li>lacks flexibility in terms of component overlaying</li>
+</ul>
+
+<p>Use-objects backed by <code>Resources</code>:</p>
+<ul>
+<li>cannot extend other Java objects</li>
+<li>the Java project might need a different setup to allow running unit tests, since the objects will be deployed like content</li>
+</ul>
+</td>
+</tr>
+<tr>
+<td>JavaScript Use Provider</td>
+<td>
+<ul>
+<li>allows JavaScript developers to develop component logic</li>
+<li>can be reused through the dependency mechanism provided by the <code>use</code> function</li>
+</ul>
+</td>
+<td>
+<ul>
+<li>harder to test and debug, relying mostly on end-to-end testing and console logging</li>
+<li>slower to execute than both Sling Models and Java Use-API objects</li>
+</ul>
+</td>
+</tr>
+<tr>
+<td>Script Use Provider</td>
+<td>
+<ul>
+<li>allows the usage of Use objects evaluated by other Script Engines available in the platform</li>
+</ul>
+</td>
+<td>
+<ul>
+<li>like in the case of the JavaScript Use Provider, the performance is influenced by the Script Engine's implementation</li>
+</ul>
+</td>
+</tr>
+</table></section></div></div>            
+<div class="footer">
+                <div class="timestamp">
+                    TODO display revision number here
+                </div><div class="trademarkFooter">
+                    Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
+                </div>
+            </div>            
+            
+        </div>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/sling-site/blob/a6129baf/documentation/bundles/scripting/scripting-jsp.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/scripting/scripting-jsp.html b/documentation/bundles/scripting/scripting-jsp.html
new file mode 100644
index 0000000..b9f6c73
--- /dev/null
+++ b/documentation/bundles/scripting/scripting-jsp.html
@@ -0,0 +1,307 @@
+<!DOCTYPE html><html lang="en">
+    <head>
+<meta charset="utf-8"/>
+        <title>Apache Sling on JBake</title>
+        <link rel="stylesheet" href="/res/css/site.css"/>
+        <link rel="stylesheet" href="/res/css/codehilite.css"/>
+        <div class="title">
+            <div class="logo">
+                <a href="http://sling.apache.org">
+                    <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/>
+                </a>
+            </div><div class="header">
+                <a href="http://www.apache.org">
+                    <img border="0" alt="Apache" src="/res/logos/apache.png"/>
+                </a>
+            </div>
+        </div>        
+    </head><body>
+<div class="menu">
+            <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h
 ref="/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/contributing.html">Contributing</a><br/><a href="/news.html">News</a><br/><a href="/links.html">Links</a><br/><a href="/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a><br/><a href="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun
 dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong>
+        </div>        <div class="main">
+<div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>JSP Scripting Engine</h1></header><p>The Apache Sling JSP Scripting Engine is implemented by the <a href="https://github.com/apache/sling/tree/trunk/bundles/scripting/jsp"><code>org.apache.sling.scripting.jsp</code></a> bundle, based on the Jasper 2 JSP engine.</p>
+<p>On top of that Apache Sling also provides its own JSP Taglib, implemented by the <a href="https://github.com/apache/sling/tree/trunk/bundles/scripting/jsp-taglib"><code>org.apache.sling.scripting.jsp.taglib</code></a> bundle.</p>
+<p>The Sling Scripting JSP Taglib supports the use of Sling as an application in JSP pages. The Sling Taglib provides the ability to invoke JSP scripts, include Resources and interact with the Sling Repository, all with JSP tags and <a href="http://docs.oracle.com/javaee/6/tutorial/doc/gjddd.html">Expression Language (EL)</a> functions.</p>
+<h2>Use</h2>
+<p>Using the Sling Taglib in a JSP page is as simple as including the Taglib include in your JSP, with the correct URI for the version of the Sling Taglib installed.</p>
+<p>&lt;%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling" %&gt;</p>
+<p>Generally, the prefix to use is <code>sling</code>. Often applications include a global JSP file which includes the Sling Taglib and sets up all of the application variables and methods.</p>
+<p>The Sling Taglib does not attempt to reproduce the functionality of other Tag Libraries, such as <a href="http://www.oracle.com/technetwork/java/index-jsp-135995.html">JSTL</a>; additional Tag Libraries may be required to fully leverage the Sling Taglib.</p>
+<h2>Taglib Versions</h2>
+<p>There have been a number of releases of the Sling Taglibs, including versions with different URIs.</p>
+<table>
+  <thead>
+    <tr>
+      <th>Taglib Version </th>
+      <th>Bundle Version </th>
+      <th>URI </th>
+    </tr>
+  </thead>
+  <tbody>
+    <tr>
+      <td>1.0 </td>
+      <td>2.0.6 </td>
+      <td>http://sling.apache.org/taglibs/sling/1.0 </td>
+    </tr>
+    <tr>
+      <td>1.1 </td>
+      <td>2.1.0 </td>
+      <td>http://sling.apache.org/taglibs/sling/1.1 </td>
+    </tr>
+    <tr>
+      <td>1.2 </td>
+      <td>2.1.8 </td>
+      <td>http://sling.apache.org/taglibs/sling/1.2 </td>
+    </tr>
+    <tr>
+      <td>1.3 </td>
+      <td>2.2.0 </td>
+      <td>http://sling.apache.org/taglibs/sling </td>
+    </tr>
+  </tbody>
+</table>
+<p>All releases from 1.3 onward are expected to use the URI <code>http://sling.apache.org/taglibs/sling</code> to ensure ease of upgrading to newer versions of the Taglib.</p>
+<h2>Expression Language Functions</h2>
+<p>The Sling Taglib includes a number of Expression Language Functions which can be used to access the repository.</p>
+<h3>adaptTo</h3>
+<p>Adapts an Adaptable to another class.</p>
+<ul>
+  <li>Returns: <code>java.lang.Object</code></li>
+  <li>Accepts:</li>
+  <li><code>org.apache.sling.api.adapter.Adaptable</code> - The object to adapt</li>
+  <li><code>java.lang.String</code> - The name of the class to which to adapt the adaptable</li>
+  <li>Since: 1.3</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;c:set var="myProperties" value="${sling:adaptTo(resource,'org.apache.sling.api.resource.ValueMap')}" /&gt;</p>
+<h3>encode</h3>
+<p>Writes properly Cross Site Scripting (XSS) encoded text to the response using the OWASP ESAPI. Supports a number of encoding modes.</p>
+<ul>
+  <li>Returns: <code>java.util.String</code> - An encoded text</li>
+  <li>Accepts:</li>
+  <li><code>java.lang.String</code> - The text to encode</li>
+  <li><code>java.lang.String</code> - The encoding mode, one of HTML, HTML_ATTR, XML, XML_ATTR, JS</li>
+  <li>Since: 1.4</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>${sling:encode('<script>alert("Bad Stuff!");</script>','HTML')}</p>
+<h3>findResources</h3>
+<p>Searches for resources using the given query formulated in the given language.</p>
+<ul>
+  <li>Returns: <code>java.util.Iterator</code> - An Iterator of Resource objects matching the query.</li>
+  <li>Accepts:</li>
+  <li><code>org.apache.sling.api.resource.ResourceResolver</code> - The Resource Resolver to use for the query.</li>
+  <li><code>java.lang.String</code> - The query string to use to find the resources.</li>
+  <li><code>java.lang.String</code> - The language in which the query is formulated.</li>
+  <li>Since: 1.3</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;c:forEach var="found" items="${sling:findResources(resourceResolver,'/jcr:root//*[jcr:contains(., 'Sling')] order by @jcr:score','xpath')"&gt; <li>${found.path}</li> &lt;/c:forEach&gt;</p>
+<h3>getRelativeResource</h3>
+<p>Gets the resource at the relative path to the provided resource.</p>
+<ul>
+  <li>Returns: <code>org.apache.sling.api.resource.Resource</code> - The resource at the relative path.</li>
+  <li>Accepts:</li>
+  <li><code>org.apache.sling.api.resource.Resource</code> - The resource relative to which to find the path.</li>
+  <li><code>java.lang.String</code> - The relative path at which to find the resource.</li>
+  <li>Since: 1.3</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;c:set var="content" value="${sling:getRelativeResource(resource,'jcr:content')}" /&gt;</p>
+<h3>getResource</h3>
+<p>Method allow for the retrieval of resources.</p>
+<ul>
+  <li>Returns: <code>org.apache.sling.api.resource.Resource</code> - The resource at the path.</li>
+  <li>Accepts:</li>
+  <li><code>org.apache.sling.api.resource.ResourceResolver</code> - The current resource resolver.</li>
+  <li><code>java.lang.String</code> - The path at which to find the resource.</li>
+  <li>Since: 1.3</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;c:set var="content" value="${sling:getResource(resourceResolver,'/content')}" /&gt;</p>
+<h3>getValue</h3>
+<p>Gets the value of the specified key from the ValueMap and either coerses the value into the specified type or uses the specified type as a default depending on the parameter passed in.</p>
+<p>If the third parameter is a class, the resulting value will be coersed into the class, otherwise, the third parameter is used as the default when retrieving the value from the <code>ValueMap</code>.</p>
+<ul>
+  <li>Returns: <code>java.lang.Object</code> - The value.</li>
+  <li>Accepts:</li>
+  <li><code>org.apache.sling.api.resource.ValueMap</code> - The ValueMap from which to retrieve the value.</li>
+  <li><code>java.lang.String</code> - The key for the value to retrieve</li>
+  <li><code>java.lang.Object</code> - Either the default value or the class to which to coerce the value.</li>
+  <li>Since: 1.3</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;c:set var="content" value="${sling:getValue(properties,'jcr:title',resource.name)}" /&gt;</p>
+<h3>listChildren</h3>
+<p>Method for allowing the invocation of the Sling Resource listChildren method.</p>
+<ul>
+  <li>Returns: <code>java.util.Iterator</code> - The children of the resource.</li>
+  <li>Accepts:</li>
+  <li><code>org.apache.sling.api.resource.Resource</code> - The resource of which to list the children.</li>
+  <li>Since: 1.3</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;c:forEach var="child" items="${sling:listChildren(resource)"&gt; <li>${child.path}</li> &lt;/c:forEach&gt;</p>
+<h2>Tags</h2>
+<p>The Sling Taglib includes a number of Tags which can be used to access the repository, handle the inclusion of scripts and manage requests.</p>
+<h3>adaptTo</h3>
+<p>Adapts adaptables to objects of other types.</p>
+<ul>
+  <li>Attributes</li>
+  <li>adaptable - The adaptable object to adapt.</li>
+  <li>adaptTo - The class name to which to adapt the adaptable.</li>
+  <li>var - The name of the variable to which to save the adapted object.</li>
+  <li>Since: 1.3</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;sling:adaptTo adaptable="${resource}" adaptTo="org.apache.sling.api.resource.ValueMap" var="myProps" /&gt;</p>
+<h3>call</h3>
+<p>Execute a script.</p>
+<ul>
+  <li>Attributes</li>
+  <li>flush - Whether to flush the output before including the target.</li>
+  <li>script - The script to include.</li>
+  <li>ignoreComponentHierarchy - Controls if the component hierarchy should be ignored for script resolution. If true, only the search paths are respected.</li>
+  <li>Since: 1.2</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;sling:call script="myscript.jsp" /&gt;</p>
+<h3>defineObjects</h3>
+<p>Defines regularly used scripting variables. By default the following scripting variables are defined through this tag:</p>
+<ul>
+  <li><strong>slingRequest</strong>, SlingHttpServletRequest object, providing access to the HTTP request header information - extends the standard HttpServletRequest - and provides access to Sling-specific things like resource, path info, selector, etc.</li>
+  <li><strong>slingResponse</strong>, SlingHttpServletResponse object, providing access for the HTTP response that is created by the server. This is currently the same as the HttpServletResponse from which it extends.</li>
+  <li><strong>resourceResolver</strong>, Current ResourceResolver. Same as slingRequest.getResourceResolver().</li>
+  <li><strong>sling</strong>, SlingScriptHelper, containing convenience methods for scripts, mainly sling.include('/some/other/resource') for including the responses of other resources inside this response (eg. embedding header html snippets) and sling.getService(foo.bar.Service.class) to retrieve OSGi services available in Sling (Class notation depending on scripting language).</li>
+  <li><strong>resource</strong>, current Resource to handle, depending on the URL of the request. Same as slingRequest.getResource().</li>
+  <li><strong>log</strong>, provides an SLF4J Logger for logging to the Sling log system from within scripts, eg. log.info("Executing my script").</li>
+  <li><strong>currentNode</strong>, the underlying JCR node (if there is one) of the current resource.</li>
+  <li><strong>bindings</strong>, provides access to the SlingBindings object for access to non-standard scripting variables.</li>
+</ul>
+<p>See also <a href="https://cwiki.apache.org/confluence/display/SLING/Scripting+variables#Scriptingvariables-JSP">Scripting variables in CMS</a></p>
+<ul>
+  <li>Attributes which allow to bind the according variables to other names than the default ones listed above.</li>
+  <li>requestName</li>
+  <li>responseName</li>
+  <li>resourceName</li>
+  <li>nodeName</li>
+  <li>logName</li>
+  <li>resourceResolverName</li>
+  <li>slingName</li>
+  <li>Since: 1.0</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;sling:defineObjects /&gt;</p>
+<h3>encode</h3>
+<p>Writes properly Cross Site Scripting (XSS) encoded text to the response using the OWASP ESAPI. Supports a number of encoding modes.</p>
+<ul>
+  <li>Attributes:</li>
+  <li>value - The text to encode</li>
+  <li>default - a default text to use if the value is null or empty</li>
+  <li>mode - The encoding mode, one of HTML, HTML_ATTR, XML, XML_ATTR, JS</li>
+  <li>Since: 1.4</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;sling:encode value="<script>alert('Bad Stuff!');</script>" mode="HTML" /&gt;</p>
+<h3>eval</h3>
+<p>Evaluates a script invocation and includes the result in the current page.</p>
+<ul>
+  <li>Attributes</li>
+  <li>flush - Whether to flush the output before including the target.</li>
+  <li>script - The path to the script object to include in the current request processing. By default, the current resource is used for script resolving. This behaviour can be changed by specifying either resource, resourceType or ignoreResourceTypeHierarchy.</li>
+  <li>resource - The resource object to include in the current request processing. This attribute is optional. If it is specified, resourceType should not be used. If both are used, resource takes precedence.</li>
+  <li>resourceType - The resource type of a resource to include. This attribute is optional. If it is specified, resource should not be used. If both are used, resource takes precedence.</li>
+  <li>ignoreResourceTypeHierarchy - Prevents using the resource type hierarchy for searching a script.</li>
+  <li>Since: 1.1</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;sling:eval script="myscript.jsp" /&gt;</p>
+<h3>findResources</h3>
+<p>Tag for searching for resources using the given query formulated in the given language.</p>
+<ul>
+  <li>Attributes</li>
+  <li>query - The query string to find the resources.</li>
+  <li>language - The query language to use.</li>
+  <li>var - The name of the variable to which to save the resources.</li>
+  <li>Since: 1.3</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;sling:findResources query="/jcr:root//*[jcr:contains(., 'Sling')] order by @jcr:score" language="xpath" var="resources" /&gt;</p>
+<h3>forward</h3>
+<p>Forwards a request to a resource rendering the current page</p>
+<ul>
+  <li>Attributes</li>
+  <li>resource - The resource object to forward the request to. Either resource or path must be specified. If both are specified, the resource takes precedences.</li>
+  <li>path - The path to the resource object to forward the request to. If this path is relative it is appended to the path of the current resource whose script is forwarding the given resource. Either resource or path must be specified. If both are specified, the resource takes precedences.</li>
+  <li>resourceType - The resource type of a resource to forward. If the resource to be forwarded is specified with the path attribute, which cannot be resolved to a resource, the tag may create a synthetic resource object out of the path and this resource type. If the resource type is set the path must be the exact path to a resource object. That is, adding parameters, selectors and extensions to the path is not supported if the resource type is set.</li>
+  <li>replaceSelectors - When dispatching, replace selectors by the value provided by this option.</li>
+  <li>addSelectors - When dispatching, add the value provided by this option to the selectors.</li>
+  <li>replaceSuffix - When dispatching, replace the suffix by the value provided by this option.</li>
+  <li>Since: 1.0</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;sling:forward path="/content/aresource" resourceType="myapp/components/display" /&gt;</p>
+<h3>getProperty</h3>
+<p>Retrieves the value from the ValueMap, allowing for a default value or coercing the return value.</p>
+<ul>
+  <li>Attributes</li>
+  <li>properties - The ValueMap from which to retrieve the value.</li>
+  <li>key - The key to retrieve the value from from the ValueMap.</li>
+  <li>defaultValue - The default value to return if no value exists for the key. If specified, this takes precedence over returnClass.</li>
+  <li>returnClass - The class into which to coerce the returned value.</li>
+  <li>var - The name of the variable to which to save the value.</li>
+  <li>Since: 1.3</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;sling:getProperties properties="${properties}" key="jcr:title" defaultValue="${resource.name}" var="title" /&gt;</p>
+<h3>getResource</h3>
+<p>Retrieves resources based on either an absolute path or a relative path and a base resource.</p>
+<ul>
+  <li>Attributes</li>
+  <li>base - The base resource under which to retrieve the child resource, will only be considered if a relative path is specified.</li>
+  <li>path - The path of the resource to retrieve, if relative, the base resource must be specified.</li>
+  <li>defaultValue - The default value to return if no value exists for the key. If specified, this takes precedence over returnClass.</li>
+  <li>returnClass - The class into which to coerce the returned value.</li>
+  <li>var - The name of the variable to which to save the resource.</li>
+  <li>Since: 1.3</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;sling:getResource base="${resource}" path="jcr:content" var="content" /&gt;</p>
+<h3>include</h3>
+<p>Includes a resource rendering into the current page.</p>
+<ul>
+  <li>Attributes</li>
+  <li>flush - Whether to flush the output before including the target.</li>
+  <li>resource - The resource object to include in the current request processing. Either resource or path must be specified. If both are specified, the resource takes precedences.</li>
+  <li>path - The path to the resource object to include in the current request processing. If this path is relative it is appended to the path of the current resource whose script is including the given resource. Either resource or path must be specified. If both are specified, the resource takes precedences.</li>
+  <li>resourceType - The resource type of a resource to include. If the resource to be included is specified with the path attribute, which cannot be resolved to a resource, the tag may create a synthetic resource object out of the path and this resource type. If the resource type is set the path must be the exact path to a resource object. That is, adding parameters, selectors and extensions to the path is not supported if the resource type is set.</li>
+  <li>replaceSelectors - When dispatching, replace selectors by the value provided by this option.</li>
+  <li>addSelectors - When dispatching, add the value provided by this option to the selectors.</li>
+  <li>replaceSuffix - When dispatching, replace the suffix by the value provided by this option.</li>
+  <li>scope - If var is specified, what scope to store the variable in. (Since 1.3)</li>
+  <li>var - variable name to store the resulting markup into (Since 1.3)</li>
+  <li>Since: 1.0</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;sling:include path="/content/aresource" resourceType="myapp/components/display" /&gt;</p>
+<h3>listChildren</h3>
+<p>Lists the children of a Sling Resource.</p>
+<ul>
+  <li>Attributes</li>
+  <li>resource - The resource for which to retrieve the children.</li>
+  <li>var - The name of the variable to which to save the child resources.</li>
+  <li>Since: 1.3</li>
+</ul>
+<p><em>Example Usage</em></p>
+<p>&lt;sling:listChildren resource="${resource}" var="children" /&gt;</p></section></div></div>            
+<div class="footer">
+                <div class="timestamp">
+                    TODO display revision number here
+                </div><div class="trademarkFooter">
+                    Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
+                </div>
+            </div>            
+            
+        </div>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/sling-site/blob/a6129baf/documentation/bundles/scripting/scripting-thymeleaf.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/scripting/scripting-thymeleaf.html b/documentation/bundles/scripting/scripting-thymeleaf.html
new file mode 100644
index 0000000..1061407
--- /dev/null
+++ b/documentation/bundles/scripting/scripting-thymeleaf.html
@@ -0,0 +1,84 @@
+<!DOCTYPE html><html lang="en">
+    <head>
+<meta charset="utf-8"/>
+        <title>Apache Sling on JBake</title>
+        <link rel="stylesheet" href="/res/css/site.css"/>
+        <link rel="stylesheet" href="/res/css/codehilite.css"/>
+        <div class="title">
+            <div class="logo">
+                <a href="http://sling.apache.org">
+                    <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/>
+                </a>
+            </div><div class="header">
+                <a href="http://www.apache.org">
+                    <img border="0" alt="Apache" src="/res/logos/apache.png"/>
+                </a>
+            </div>
+        </div>        
+    </head><body>
+<div class="menu">
+            <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h
 ref="/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/contributing.html">Contributing</a><br/><a href="/news.html">News</a><br/><a href="/links.html">Links</a><br/><a href="/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a><br/><a href="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun
 dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong>
+        </div>        <div class="main">
+<div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>Sling Scripting Thymeleaf</h1></header><p>Sling Scripting Thymeleaf is the scripting engine for <a href="http://www.thymeleaf.org"><em>Thymeleaf</em></a> (3.0) templates.</p>
+<p>[TOC]</p>
+<h1>Features</h1>
+<ul>
+  <li>Supporting all of Thymeleaf's extension points: <a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/templateresolver/ITemplateResolver.html"><em>TemplateResolver</em></a>s, <a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/messageresolver/IMessageResolver.html"><em>MessageResolver</em></a>s, <a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/dialect/IDialect.html"><em>Dialect</em></a>s, <a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/linkbuilder/ILinkBuilder.html"><em>LinkBuilder</em></a>s, <a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/templateparser/markup/decoupled/IDecoupledTemplateLogicResolver.html"><em>DecoupledTemplateLogicResolver</em></a>, <a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/cache/ICacheManager.html"><em>CacheManager</em></a> and <a href="http://www.thymeleaf.org
 /apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/context/IEngineContext.html"><em>EngineContextFactory</em></a></li>
+  <li><code>SlingResourceTemplateResolver</code> customizable through <code>TemplateModeProvider</code></li>
+  <li><code>ResourceBundleMessageResolver</code> backed by <code>ResourceBundleProvider</code> from <a href="https://sling.apache.org/documentation/bundles/internationalization-support-i18n.html">Sling i18n</a> customizable through optional <code>AbsentMessageRepresentationProvider</code></li>
+  <li><code>PatternTemplateModeProvider</code> supporting <a href="https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html"><code>Pattern</code></a> configurations for all <a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/templatemode/TemplateMode.html">template modes</a> (<code>HTML</code>, <code>XML</code>, <code>TEXT</code>, <code>JAVASCRIPT</code>, <code>CSS</code> and <code>RAW</code>)</li>
+  <li><code>SlingDialect</code></li>
+  <li>Thymeleaf's <a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/ITemplateEngine.html"><code>TemplateEngine</code></a> registered as OSGi Service (<a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/ITemplateEngine.html"><code>ITemplateEngine</code></a>) for direct use</li>
+</ul>
+<h1>Installation</h1>
+<p>For running Sling Scripting Thymeleaf with Sling's Launchpad some dependencies need to be resolved. This can be achieved by installing the following bundles:</p>
+<p>mvn:org.attoparser/attoparser/2.0.2.RELEASE mvn:org.unbescape/unbescape/1.1.4.RELEASE mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ognl/3.2_1 mvn:org.javassist/javassist/3.20.0-GA</p>
+<p>There is a feature for Karaf:</p>
+<p>karaf@root()&gt; feature:install sling-scripting-thymeleaf</p>
+<p><strong>Note:</strong> Sling Scripting Thymeleaf requires an implementation of OSGi Declarative Services 1.3 (e.g. <a href="http://felix.apache.org/documentation/subprojects/apache-felix-service-component-runtime.html">Apache Felix Service Component Runtime</a> 2.0.0 or greater)</p>
+<h1>Configuration</h1>
+<h2>Apache Sling Scripting Thymeleaf “ScriptEngineFactory”</h2>
+<p>By default Sling Scripting Thymeleaf's <em>ScriptEngineFactory</em> is configured for templates with extension <code>html</code> and mime type <code>text/html</code> and uses all of Thymeleaf's standard extensions either <em>also</em> or <em>exclusively</em>.</p>
+<p><img src="Scripting-Thymeleaf-ScriptEngineFactory.png" alt="Apache Sling Scripting Thymeleaf “ScriptEngineFactory”" /></p>
+<h2>Apache Sling Scripting Thymeleaf “Sling Resource TemplateResolver”</h2>
+<p>The <em>Sling Resource TemplateResolver</em> is configured to resolve templates with <em>use decoupled logic</em> enabled.</p>
+<p><img src="Scripting-Thymeleaf-Sling-Resource-TemplateResolver.png" alt="Apache Sling Scripting Thymeleaf “Sling Resource TemplateResolver”" /></p>
+<h2>Apache Sling Scripting Thymeleaf “Pattern TemplateModeProvider”</h2>
+<p>The <em>Pattern TemplateModeProvider</em> is configured to match template paths against default extensions for providing template modes (of course except no-op mode <code>RAW</code>).</p>
+<p><img src="Scripting-Thymeleaf-Pattern-TemplateModeProvider.png" alt="Apache Sling Scripting Thymeleaf “Pattern TemplateModeProvider" /></p>
+<h2>Apache Sling Scripting Thymeleaf “ResourceBundle MessageResolver”</h2>
+<p>The <em>ResourceBundle MessageResolver</em> is configured to use the message's key as absent message representation.</p>
+<p><img src="Scripting-Thymeleaf-ResourceBundle-MessageResolver.png" alt="Apache Sling Scripting Thymeleaf “ResourceBundle MessageResolver”" /></p>
+<h1>Sling Dialect</h1>
+<p>Sling Scripting Thymeleaf comes with its own dialect using the <code>sling</code> prefix/namespace currently supporting the <em>include</em> feature known from <a href="/documentation/bundles/scripting/scripting-jsp.html">Sling Scripting JSP Taglib</a>.</p>
+<h2>include</h2>
+<p><code>&lt;header data-sling-include=&quot;${resource}&quot; data-sling-resourceType=&quot;&#39;example/page/header&#39;&quot; data-sling-unwrap=&quot;true&quot;/&gt;</code></p>
+<p><code>include</code> - The resource object (<a href="http://sling.apache.org/apidocs/sling7/org/apache/sling/api/resource/Resource.html"><code>Resource</code></a>) or the path (<code>String</code>) of the resource object to include in the current request processing. If this path is relative it is appended to the path of the current resource whose script is including the given resource.</p>
+<h3>supported options (* = <a href="http://sling.apache.org/apidocs/sling7/org/apache/sling/api/request/RequestDispatcherOptions.html">RequestDispatcher option</a>)</h3>
+<ul>
+  <li><code>addSelectors</code> (<code>String</code>) *: When dispatching, add the value provided by this option to the selectors.
+</li>
+  <li><code>replaceSelectors</code> (<code>String</code>) *: When dispatching, replace selectors by the value provided by this option.
+</li>
+  <li><code>replaceSuffix</code> (<code>String</code>) *: When dispatching, replace the suffix by the value provided by this option.
+</li>
+  <li><code>resourceType</code> (<code>String</code>) *: The resource type of a resource to include. If the resource to be included is specified with the path attribute, which cannot be resolved to a resource, the tag may create a synthetic resource object out of the path and this resource type. If the resource type is set the path must be the exact path to a resource object. That is, adding parameters, selectors and extensions to the path is not supported if the resource type is set.
+</li>
+  <li><code>unwrap</code> (<code>Boolean</code>): removes the host element</li>
+</ul>
+<h1>Class Diagram</h1>
+<p><a href="Scripting-Thymeleaf-Class-Diagram.png"><img src="Scripting-Thymeleaf-Class-Diagram.png" alt="Class Diagram" /></a></p>
+<h1>Sample</h1>
+<p>The <a href="http://svn.apache.org/repos/asf/sling/trunk/samples/fling/">Sling Fling Sample</a> is a sample using Sling Scripting Thymeleaf with <a href="/documentation/bundles/models.html">Sling Models</a> and <a href="/documentation/bundles/sling-query.html">Sling Query</a>.</p>
+<p><img src="sling-fling-sample.png" alt="Sling Fling Sample" /></p></section></div></div>            
+<div class="footer">
+                <div class="timestamp">
+                    TODO display revision number here
+                </div><div class="trademarkFooter">
+                    Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
+                </div>
+            </div>            
+            
+        </div>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/sling-site/blob/a6129baf/documentation/bundles/servlet-helpers.html
----------------------------------------------------------------------
diff --git a/documentation/bundles/servlet-helpers.html b/documentation/bundles/servlet-helpers.html
new file mode 100644
index 0000000..1afcb14
--- /dev/null
+++ b/documentation/bundles/servlet-helpers.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html><html lang="en">
+    <head>
+<meta charset="utf-8"/>
+        <title>Apache Sling on JBake</title>
+        <link rel="stylesheet" href="/res/css/site.css"/>
+        <link rel="stylesheet" href="/res/css/codehilite.css"/>
+        <div class="title">
+            <div class="logo">
+                <a href="http://sling.apache.org">
+                    <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/>
+                </a>
+            </div><div class="header">
+                <a href="http://www.apache.org">
+                    <img border="0" alt="Apache" src="/res/logos/apache.png"/>
+                </a>
+            </div>
+        </div>        
+    </head><body>
+<div class="menu">
+            <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h
 ref="/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/contributing.html">Contributing</a><br/><a href="/news.html">News</a><br/><a href="/links.html">Links</a><br/><a href="/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a><br/><a href="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun
 dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong>
+        </div>        <div class="main">
+<div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>Sling Servlet Helpers</h1></header><p>The Sling Servlet Helpers bundle provides mock implementations of the <code>SlingHttpServletRequest</code>, <code>SlingHttpServletResponse</code> and related classes.</p>
+<p>Those mock implementations are meant to be used in tests and also with services like the <code>SlingRequestProcessor</code> when making requests to that service outside of an HTTP request processing context.</p>
+<p>See the <a href="https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/servlet-helpers">automated tests</a> of the <code>servlet-helpers</code> module for more info.</p>
+<h2>Usage</h2>
+<h3>SlingHttpServletRequest</h3>
+<p>Example for preparing a sling request with custom request data:</p>
+<h1>!java</h1>
+<p>// prepare sling request MockSlingHttpServletRequest request = new MockSlingHttpServletRequest(resourceResolver);</p>
+<p>// simulate query string request.setQueryString("param1=aaa&amp;param2=bbb");</p>
+<p>// alternative - set query parameters as map request.setParameterMap(ImmutableMap.&lt;String,Object&gt;builder() .put("param1", "aaa") .put("param2", "bbb") .build());</p>
+<p>// set current resource request.setResource(resourceResolver.getResource("/content/sample"));</p>
+<p>// set sling request path info properties MockRequestPathInfo requestPathInfo = (MockRequestPathInfo)request.getRequestPathInfo(); requestPathInfo.setSelectorString("selector1.selector2"); requestPathInfo.setExtension("html");</p>
+<p>// set method request.setMethod(HttpConstants.METHOD_POST);</p>
+<p>// set attributes request.setAttribute("attr1", "value1");</p>
+<p>// set headers request.addHeader("header1", "value1");</p>
+<p>// set cookies request.addCookie(new Cookie("cookie1", "value1"));</p>
+<h3>SlingHttpServletResponse</h3>
+<p>Example for preparing a sling response which can collect the data that was written to it:</p>
+<h1>!java</h1>
+<p>// prepare sling response MockSlingHttpServletResponse response = new MockSlingHttpServletResponse();</p>
+<p>// execute the code that writes to the response...</p>
+<p>// validate status code assertEquals(HttpServletResponse.SC_OK, response.getStatus());</p>
+<p>// validate content type and content length assertEquals("text/plain;charset=UTF-8", response.getContentType()); assertEquals(CharEncoding.UTF_8, response.getCharacterEncoding()); assertEquals(55, response.getContentLength());</p>
+<p>// validate headers assertTrue(response.containsHeader("header1")); assertEquals("5", response.getHeader("header2"));</p>
+<p>// validate response body as string assertEquals(TEST_CONTENT, response.getOutputAsString());</p>
+<p>// validate response body as binary data assertArrayEquals(TEST_DATA, response.getOutput());</p></section></div></div>            
+<div class="footer">
+                <div class="timestamp">
+                    TODO display revision number here
+                </div><div class="trademarkFooter">
+                    Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
+                </div>
+            </div>            
+            
+        </div>
+    </body>
+</html>