You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bu...@apache.org on 2012/12/12 10:17:17 UTC

svn commit: r841833 [16/28] - in /websites/staging/sling/trunk/content: ./ site/ site/46-line-blog.data/ site/authentication.data/ site/documentation.data/ site/first-steps.data/ site/getting-and-building-sling.data/ site/how-to-manage-events-in-sling....

Added: websites/staging/sling/trunk/content/site/manipulating-content-the-slingpostservlet-servletspost.html
==============================================================================
--- websites/staging/sling/trunk/content/site/manipulating-content-the-slingpostservlet-servletspost.html (added)
+++ websites/staging/sling/trunk/content/site/manipulating-content-the-slingpostservlet-servletspost.html Wed Dec 12 09:16:44 2012
@@ -0,0 +1,1329 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+  <HEAD>
+    <TITLE>Apache Sling - Manipulating Content - The SlingPostServlet (servlets.post)</TITLE>
+    <LINK rel="stylesheet" href="http://sling.apache.org/site/media.data/site.css" type="text/css" media="all">
+    <LINK rel="icon" href="http://sling.apache.org/site/media.data/favicon.ico">
+    <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </HEAD>
+  <BODY>
+    <DIV class="title">
+      <DIV class="logo">
+        <A href="http://sling.apache.org/site/index.html">
+          <IMG border="0" alt="Apache Sling" src="http://sling.apache.org/site/media.data/logo.png">
+        </A>
+      </DIV>
+      <DIV class="header">
+        <A href="http://www.apache.org/">
+          <IMG border="0" alt="Apache" src="http://sling.apache.org/site/media.data/apache.png">
+        </A>
+      </DIV>
+    </DIV>
+    <DIV class="menu">
+<P><B>Documentation</B><BR class="atl-forced-newline">
+<A href="getting-started.html" title="Getting Started">Getting Started</A><BR class="atl-forced-newline">
+<A href="the-sling-engine.html" title="The Sling Engine">The Sling Engine</A><BR class="atl-forced-newline">
+<A href="development.html" title="Development">Development</A><BR class="atl-forced-newline">
+<A href="bundles.html" title="Bundles">Bundles</A><BR class="atl-forced-newline">
+<A href="tutorials-how-tos.html" title="Tutorials & How-Tos">Tutorials &amp; How&#45;Tos</A><BR class="atl-forced-newline">
+<A href="configuration.html" title="Configuration">Configuration</A><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/apidocs/sling6/index.html" class="external-link" rel="nofollow">API docs</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.wiki" class="external-link" rel="nofollow">Wiki</A><BR class="atl-forced-newline">
+<A href="http://s.apache.org/sling.faq" class="external-link" rel="nofollow">FAQ</A><BR class="atl-forced-newline"></P>
+
+<P><B>Project info</B><BR class="atl-forced-newline">
+<A href="http://sling.apache.org/site/downloads.cgi" class="external-link" rel="nofollow">Downloads</A><BR class="atl-forced-newline">
+<A href="http://www.apache.org/licenses/" class="external-link" rel="nofollow">License</A><BR class="atl-forced-newline">
+<A href="contributing.html" title="Contributing">Contributing</A><BR class="atl-forced-newline">
+<A href="news.html" title="News">News</A><BR class="atl-forced-newline">
+<A href="links.html" title="Links">Links</A><BR class="atl-forced-newline">
+<A href="project-information.html" title="Project Information">Project Information</A><BR class="atl-forced-newline">
+<A href="https://issues.apache.org/jira/browse/SLING" class="external-link" rel="nofollow">Issue Tracker</A><BR class="atl-forced-newline">
+<A href="http://svn.apache.org/viewvc/sling/trunk" class="external-link" rel="nofollow">Browse Source Repository</A><BR class="atl-forced-newline">
+<A href="security.html" title="Security">Security</A><BR class="atl-forced-newline"></P>
+
+<P><B>Sponsorship</B><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/thanks.html" class="external-link" rel="nofollow">Thanks</A><BR class="atl-forced-newline">
+<A href="http://www.apache.org/foundation/sponsorship.html" class="external-link" rel="nofollow">Become a Sponsor</A><BR>
+<A href="http://www.apache.org/foundation/buy_stuff.html" class="external-link" rel="nofollow">Buy Stuff</A></P>
+
+
+  <IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+  <P style="height: 135px"></P>
+    </DIV>
+    <DIV class="main">
+        <DIV class="breadcrump" style="font-size: 80%;">
+<A href="apache-sling.html" title="Apache Sling Website">Apache Sling Website</A>&nbsp;&gt;&nbsp;<A href="apache-sling.html" title="Apache Sling">Apache Sling</A>&nbsp;&gt;&nbsp;<A href="documentation.html" title="Documentation">Documentation</A>&nbsp;&gt;&nbsp;<A href="bundles.html" title="Bundles">Bundles</A>&nbsp;&gt;&nbsp;<A href="" title="Manipulating Content - The SlingPostServlet (servlets.post)">Manipulating Content - The SlingPostServlet (servlets.post)</A>
+        </DIV>
+<H1><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-ManipulatingContent%3ATheSlingPostServlet"></A>Manipulating Content: The SlingPostServlet</H1>
+
+
+<DIV>
+<UL>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-MultipleWaystoModifyContent">Multiple Ways to Modify Content</A></LI>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-Quickstart%253ACreatingContent">Quickstart: Creating Content</A></LI>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-Preface%253Amultipart%252FformdataPOSTs">Preface: multipart/form-data POSTs</A></LI>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-SlingPostServletOperations">SlingPostServlet Operations</A></LI>
+<UL>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-ContentCreationorModification">Content Creation or Modification</A></LI>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-ContentRemoval">Content Removal</A></LI>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-CopyingContent">Copying Content</A></LI>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-MovingContent">Moving Content</A></LI>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-ImportingContentStructures">Importing Content Structures</A></LI>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-NullOperation">Null Operation</A></LI>
+</UL>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-SpecialParameters">Special Parameters</A></LI>
+<UL>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-%257B%257B%253Aorder%257D%257D"> <TT>:order</TT></A></LI>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-%257B%257B%253Aredirect%257D%257D"> <TT>:redirect</TT></A></LI>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-%257B%257B%253Astatus%257D%257D"> <TT>:status</TT></A></LI>
+</UL>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-Responseformat">Response format</A></LI>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-VersionableNodeSupport">Versionable Node Support</A></LI>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-ExtendingtheSlingPostServlet">Extending the SlingPostServlet</A></LI>
+<UL>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-AdditionalPOSToperations">Additional POST operations</A></LI>
+    <LI><A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-SlingPostProcessor">SlingPostProcessor</A></LI>
+</UL>
+</UL></DIV>
+
+
+
+<H2><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-MultipleWaystoModifyContent"></A>Multiple Ways to Modify Content</H2>
+
+<P>As always in life there is more than one way to do it. So to modify content in a JCR repository underlying Sling, you have multiple options, two of which are WebDAV and the Sling default POST Servlet also called the <EM>SlingPostServlet</EM>. This page is about how you can modify - create, modify, copy, move, delete, import - content through the <EM>SlingPostServlet</EM>. In addition it also explains how to extend the SlingPostServlet with new operations.</P>
+
+
+<P>What is Content anyway ? In the following discussion, I use the terms <EM>Content</EM> and <EM>Item</EM> interchangeably. With <EM>Content</EM> I just mean some data to be stored in the JCR repository to be later used as the basis for some presentation. In this sense <EM>Content</EM> is a rather conceptual term. <EM>Item</EM> is the name of the parent interface of the JCR <EM>Node</EM> and <EM>Property</EM> interfaces. When speaking of <EM>Items</EM> we mean some actual data stored in the repository ignoring whether the data is actually stored as a <EM>Node</EM> with child nodes and properties or just a single <EM>Property</EM>.</P>
+
+
+<H2><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-Quickstart%3ACreatingContent"></A>Quickstart: Creating Content</H2>
+
+<P>To create content you simply send an HTTP POST request using the path of the node to store the content in and include the actual content as request parameters. So one possibility to do just that is by having an HTML Form like the following:</P>
+
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//host/some/<SPAN class="code-keyword">new</SPAN>/content&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;
+</SPAN>   &lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;title&quot;</SPAN> value=&quot;&quot; /&gt;
+   &lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;text&quot;</SPAN> value=&quot;&quot; /&gt;
+&lt;/form&gt;
+</PRE>
+</DIV></DIV>
+
+
+<P>This simple form will set the <TT>title</TT> and <TT>text</TT> properties on a node at <TT>/some/new/content</TT>. If this node does not exist it is just created otherwise the existing content would be modified.</P>
+
+<P>Similarly you can do this using the <TT>curl</TT> command line tool:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ curl -Ftitle=&quot;some title text&quot; -Ftext=&quot;some body text content&quot; http://host/some/new/content
+</PRE>
+</DIV></DIV>
+
+
+<P>You might want to use a specific JCR node type for a newly created node. This is possibly by simply setting a <TT>jcr:primaryType</TT> property on the request, e.g.</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ curl -F&quot;jcr:primaryType=nt:unstructured&quot; -Ftitle=&quot;some title text&quot; -Ftext=&quot;some body text content&quot; http://host/some/new/content
+</PRE>
+</DIV></DIV>
+
+<P>Similary you may assing JCR mixin node types using the <TT>jcr:mixinTypes</TT> property and a Sling resource type using the <TT>sling:resourceType</TT> property. For example:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ curl -F&quot;sling:resourceType=sling:sample&quot; -Ftitle=&quot;some title text&quot; -Ftext=&quot;some body text content&quot; http://host/some/new/content
+</PRE>
+</DIV></DIV>
+
+
+<H2><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-Preface%3Amultipart%2FformdataPOSTs"></A>Preface: multipart/form-data POSTs</H2>
+
+<P>Sometimes you might want to have the content modifications applied in a certain order. This is particularly interesting if you use fields to create child nodes and if you want to stipulate a certain child node order based on the form fields.</P>
+
+<P>In this case ensure you are submitting the POST request using <TT>multipart/form-data</TT> encoding. This preserves the order of parameter application according to the original HTML form. To this avail ensure to always include the <TT>enctype=&quot;multipart/form-data&quot;</TT> attribute with the <TT>&lt;form&gt;</TT> tag.</P>
+
+<P>This support requires Sling Engine 2.1.0 and the Sling Default Post Servlet 2.0.6.</P>
+
+
+<H2><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-SlingPostServletOperations"></A>SlingPostServlet Operations</H2>
+
+<P>The SlingPostServlet is actually just a frontend to the actual operations. To select the actual operation to execute, the <TT>:operation</TT> request parameter is used. Out of the box, the SlingPostServlet supports the following operations:</P>
+
+<UL>
+	<LI>property not set or empty &ndash; Create new content or modify existing content</LI>
+	<LI><TT>delete</TT> &ndash; Remove existing content</LI>
+	<LI><TT>move</TT> &ndash; Move existing content to a new location</LI>
+	<LI><TT>copy</TT> &ndash; Copy existing content to a new location</LI>
+	<LI><TT>import</TT> &ndash; Import content structures from JSON/XML/Zip</LI>
+	<LI><TT>nop</TT> &ndash; Explicitly requests to do nothing and just sets the response status</LI>
+	<LI><TT>checkin</TT> - Check in a versionable node</LI>
+	<LI><TT>checkout</TT> - Check out a versionable node</LI>
+</UL>
+
+
+<P>All these operations always operate on the resource of the request as returned by <TT>SlingHttpServletRequest.getResource()</TT>. Some operations require additional parameters to be set to operate completely.</P>
+
+<P>Please note that operations are mutually exclusive. For a single POST request only one operation may be executed. Operations also only consume the request parameters as described below. Any excess parameters are silently ignored.</P>
+
+<DIV class="panelMacro"><TABLE class="noteMacro"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD valign="top"><IMG src="https://cwiki.apache.org/confluence/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD><B>Automated Tests</B><BR>Note that the <TT>launchpad/testing</TT> module contains a number of <A href="http://svn.apache.org/repos/asf/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post" class="external-link" rel="nofollow">integration tests</A> for the SlingPostServlet. Most of these tests are fairly readable, and can be used to find out more details about the servlet's behavior.</TD></TR></TABLE></DIV>
+
+<DIV class="panelMacro"><TABLE class="noteMacro"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD valign="top"><IMG src="https://cwiki.apache.org/confluence/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD><B>Trailing star in the :applyTo parameter</B><BR>This applies to operations that use this parameter, since version 2.1.2 of the <EM>org.apache.sling.servlets.post</EM> bundle: If the last segment of the <TT>:applyTo</TT> value is '*' then the operation applies to all the children of the resolved parent resource. This can be used to act on all the children <BR>
+of a resource without having to specify the path of each individual child resource.</TD></TR></TABLE></DIV>
+
+<H3><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-ContentCreationorModification"></A>Content Creation or Modification</H3>
+
+
+<P>The simplest and most common use case, probably, is content creation and modification. We already saw an example above in the quickstart section. In this section we elaborate more on the concrete stuff.</P>
+
+<P>First, the request URL indicates the actual repository node to be handled. If the URL addresses an existing node, the request parameters just provide values for the properties to be set on the existing node.</P>
+
+<P>If the resource of the request is a synthetic resource, e.g. <TT>NonExistingResource</TT> or <TT>StarResource</TT>, a new item is created. The path (including name) of the item to be created is derived from the resource path:</P>
+
+<UL>
+	<LI>If the resource path ends with a <TT>/*</TT> or <TT>/</TT> the name of the item is automatically created using a name creation algorithm taking into account various request parameters.</LI>
+	<LI>Otherwise the resource path is used as the path and name of the new item.</LI>
+</UL>
+
+
+<P>In both cases the path may still include selectors and extensions, which are cut off the path before finding out, what to do.</P>
+
+<P>To illustrate this algorithm, lets look at some examples (and check the <TT><A href="https://svn.apache.org/repos/asf/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletCreateTest.java" class="external-link" rel="nofollow">PostServletCreateTest</A></TT> in case of doubt):</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Resource Path </TH>
+<TH class="confluenceTh"> Item path </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/new</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/new</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/new.html</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/new</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/new.print.a4.html</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/new</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/xxx</TT> where <TT>xxx</TT> is a generated name </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/*</TT></TD>
+<TD class="confluenceTd"> <TT>/content/xxx</TT> where <TT>xxx</TT> is a generated name </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/*.html</TT></TD>
+<TD class="confluenceTd"> <TT>/content/xxx</TT> where <TT>xxx</TT> is a generated name </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/*.print.a4.html</TT></TD>
+<TD class="confluenceTd"> <TT>/content/xxx</TT> where <TT>xxx</TT> is a generated name </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+
+<H5><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-SettingPropertyValues"></A>Setting Property Values</H5>
+
+<P>Setting property values is as simple as just adding a request parameter whose name is the name of the property to be set and whose value is the value to be assigned to the property. We already saw how to do this in the quick start examples above.</P>
+
+<P>Here is another example show a simple HTML form to create a new node with an automatically created name:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+<SPAN class="code-tag">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;/content/page/first&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;title&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;text&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;Submit&quot;</SPAN> /&gt;</SPAN>
+<SPAN class="code-tag">&lt;/form&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>If this form is submitted with <EM>title</EM> and <EM>This is some Text</EM> as values for the <TT>title</TT> and <TT>text</TT> fields, resp., a new node is created at the path <TT>/content/page/first</TT> and the <TT>title</TT> and <TT>text</TT> properties set to the respective field values. If a node at <TT>/content/page/first</TT> already existed before submitting the form, the <TT>title</TT> and <TT>text</TT> properties are just updated to the new values from the form fields.</P>
+
+<P>If a parameter has multiple values, the respective property will be created as a multi-value property. So for example the command line:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ curl -Fmulti=one -Fmulti=two http://host/content/page
+</PRE>
+</DIV></DIV>
+
+<P>Would assign the <TT>/content/page/multi</TT> property the value <EM>[ &quot;one&quot;, &quot;two&quot; ]</EM>.</P>
+
+<P>This is pretty much all there is to know about creating and modifying content. The following sections will now introduce more functionality which help you with more fine-grained control in your content management application.</P>
+
+<H5><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-Automaticpropertyvalues%3Alastmodifiedandcreatedby"></A>Automatic property values: last modified and created by</H5>
+<P>To make it easier to set &quot;last modified&quot; and &quot;created by&quot; property values from POST requests, values are generated automatically for the following property names if they are supplied with empty values in such a request:</P>
+
+<UL>
+	<LI><TT>created</TT> and <TT>jcr:created</TT> are set to the node creation time, as a Date value.</LI>
+</UL>
+
+
+<UL>
+	<LI><TT>lastModified</TT>, <TT>jcr:lastModified</TT> are set to the node modification time, as a Date value.</LI>
+</UL>
+
+
+<UL>
+	<LI><TT>createdBy</TT> and <TT>jcr:createdBy</TT> are set to the name of the user who created the node.</LI>
+</UL>
+
+
+<UL>
+	<LI><TT>lastModifiedBy</TT>, <TT>jcr:lastModifiedBy</TT> are set to the name of the user who modified the node.</LI>
+</UL>
+
+
+<P>See the <A href="https://svn.apache.org/repos/asf/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/SlingAutoPropertiesTest.java" class="external-link" rel="nofollow">SlingAutoPropertiesTest</A> integration test for details.</P>
+
+<H5><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-FileUploads"></A>File Uploads</H5>
+
+<P>File uploads are typically done using the <TT>&lt;input type=&quot;file&quot;&quot;/&gt;</TT> element of an HTML form and ensuring the correct form encoding. The SlingPostServlet handles uploaded files specially, in that the file data is not simply written into a property, but a node is actually created with three properties:</P>
+
+<UL>
+	<LI><TT>jcr:data</TT> &ndash; The actual file contents</LI>
+	<LI><TT>jcr:lastModified</TT> &ndash; The time stamp of processing the uploaded file</LI>
+	<LI><TT>jcr:mimeType</TT> &ndash; The MIME type from the original file submission (if contained in the file body part) or derived from the original file name</LI>
+</UL>
+
+
+<P>The name of the node is either taken from the parameter name or if the name is <TT>*</TT> from the name of the uploaded file.</P>
+
+<P>The primary node type of the uploaded file is selected using the following algorithm:</P>
+
+<OL>
+	<LI>If a <TT>@TypeHint</TT> suffixed parameter (see below for a description) is present check whether the value is a known non-mixin node type. If so, the node is created with this primary node type.</LI>
+	<LI>If a <TT>@TypeHint</TT> suffixed parameter is not present or the value does not denote an existing non-mixin node type, the node will be created as an <TT>nt:file</TT> node if the parent node is of type <TT>nt:folder</TT>. Otherwise the node will be created with primary node type <TT>nt:resource</TT>.</LI>
+</OL>
+
+
+<P>If the node to be created is <TT>nt:file</TT>, the actual file data will really be stored in the <TT>jcr:content</TT> child node of the new <TT>nt:file</TT> node whose primary node type is then set as <TT>nt:resource</TT>.</P>
+
+<P>Example 1: Upload an image to a node named <TT>image</TT> below <TT>/content/page</TT>:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+<SPAN class="code-tag">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;/content/page&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;file&quot;</SPAN> name=<SPAN class="code-quote">&quot;image&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;Submit&quot;</SPAN> /&gt;</SPAN>
+<SPAN class="code-tag">&lt;/form&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+
+<P>Example 2: Upload a file as a node of type <TT>nt:file</TT> below <TT>/content/folder</TT>:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+<SPAN class="code-tag">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;/content/page&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;file&quot;</SPAN> name=<SPAN class="code-quote">&quot;*&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;*@TypeHint&quot;</SPAN> value=<SPAN class="code-quote">&quot;nt:file&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;Submit&quot;</SPAN> /&gt;</SPAN>
+<SPAN class="code-tag">&lt;/form&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>Assuming the user selected a file named <TT>myImage.jpg</TT> the uploaded file would be stored in an <TT>nt:file</TT> node at <TT>/content/folder/myImage.jpg</TT>.</P>
+
+
+
+<H5><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-Dateproperties"></A>Date properties</H5>
+
+<P>Parameters providing date/time values to be stored in JCR properties of type <EM>Date</EM> require special handling. The problem is that there are a number of formats to represent such date/time values. To account for this open-ended list of formats, the Sling Post Servlet supports configurability of the process of parsing strings into <TT>Calendar</TT> objects.</P>
+
+<P>The Sling Post Servlet configuration property <TT>servlet.post.dateFormats</TT> takes a list of format strings which are used to setup <TT>java.text.SimpleDateFormat</TT> instances for parsing date/time string representations. A special format string <TT>ISO8601</TT> is supported to indicate the string to be parsed as a JCR standard string representation of a <EM>Date</EM> property.</P>
+
+<P>The default list of configured date/time parse pattern is :</P>
+
+<UL>
+	<LI>EEE MMM dd yyyy HH:mm:ss 'GMT'Z</LI>
+	<LI>ISO8601</LI>
+	<LI>yyyy-MM-dd'T'HH:mm:ss.SSSZ</LI>
+	<LI>yyyy-MM-dd'T'HH:mm:ss</LI>
+	<LI>yyyy-MM-dd</LI>
+	<LI>dd.MM.yyyy HH:mm:ss</LI>
+	<LI>dd.MM.yyyy</LI>
+</UL>
+
+
+<P>Any date/time string parameter supplied is subject to the patterns in the configured order. The first pattern accepting the string and parsing it into a <TT>Date</TT> &ndash; and thus a <TT>Calendar</TT> &ndash; object is used. Therefore this list is best ordered in a most-stringent to least-stringent order.</P>
+
+
+
+<H5><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-OmittingSomeParameters"></A>Omitting Some Parameters</H5>
+
+<P>There may be times, that you have forms which contain a lot of fields, which you do not want to actually store in content. Such forms usually are created using some client-side GUI library which uses the fields for its own purposes. To be able to easily differentiate between real content to be actually stored and such control parameters, you may prefix the names of the fields destined for content with a dot-slash (<TT>./</TT>).</P>
+
+<P>As soon as the SlingPostServlet encounters parameters prefixed with dot-slash, only those parameters are considered for content updates while all other parameters not prefixed are just ignored. In addition to dot-slash prefixed parameters, also parameters prefixed with dot-dot-slash (<TT>../</TT>) and slash (<TT>/</TT>) are considered in this situation.</P>
+
+<P>For example, the following form only uses the first two fields for content update and ignores the rest:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+<SPAN class="code-tag">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;/content/page/first&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;./title&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;../first/text&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;control0&quot;</SPAN> /&gt;</SPAN><SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- ignored --&gt;</SPAN></SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;control1&quot;</SPAN> /&gt;</SPAN><SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- ignored --&gt;</SPAN></SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;Submit&quot;</SPAN> /&gt;</SPAN>
+<SPAN class="code-tag">&lt;/form&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>Because the SlingPostServlet encounters the <TT>./title</TT> parameter, only parameters prefixed with dot-slash, dot-dot-slash and slash are considered for content update. In this case this would <TT>./title</TT> and <TT>../first/text</TT> while <TT>control0</TT> and <TT>control1</TT> are not prefixed and thus ignored.</P>
+
+<P>Background: The name of the parameters used for content update are actually intended to be relative path names of the properties to modify. So in effect using the field name <TT>text</TT> is equivalent to <TT>./text</TT> &ndash; dot-slash meaning relative to the current node identified by the <TT>action</TT> attribute value for <TT>form</TT> tag &ndash; or <TT>../first/text</TT> if <TT>first</TT> is the name of the node to modify &ndash; dot-dot-slash meaning relative to the parent node of the node identified by the <TT>action</TT> attribute value of the <TT>form</TT> tag.</P>
+
+<P>In addition to the mechanism explained here, the following parameters are also ignored:</P>
+
+<UL>
+	<LI>Parameters whose name start with a colon (<TT>:</TT>) are always ignored by the SlingPostServlet with respect to content update. The reason is that the prefixing colon is intended as a marker for SlingPostServlet control parameters.</LI>
+	<LI>The <TT>&#95;charset&#95;</TT> request parameter is also never written back because this parameter is used to convey the character encoding used to transport the request parameters.</LI>
+	<LI>Request parameters matching a regular expression supplied with the <TT>servlet.post.ignorePattern</TT> configuration parameter are also ignored. By default this pattern is <TT>j_.*</TT> thus ignoring any request parameters with the prefix <TT>j_</TT> such as <TT>j_username</TT>. Those request parameters are generally used for authentication purposes and may hit the Sling POST Servlet in some situations.</LI>
+</UL>
+
+
+
+<H5><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-ControllingContentUpdateswith%7B%7B@%7D%7DSuffixes"></A>Controlling Content Updates with <TT>@</TT> Suffixes</H5>
+
+<P>Generally just creating forms with parameters and their values suffices it completely. Sometimes, though, you want to have more control on how the parameter values are actually stored in the properties. For example, you want to set a property to a default value if the user did provide an actual value. Or you might want to store a parameter explicitly with a given data type, such as numeric, boolean etc.</P>
+
+<P>The SlingPostServlet provides such property control in the form of <TT>@</TT> suffixed parameters, which are now presented.</P>
+
+<P>The <TT>@</TT> suffixed parameters are not used on their own but always in conjunction with a plain parameter. The part of the parameter name before the <TT>@</TT> suffix is used in this case for correlation and must match exactly the name of the parameter to which the <TT>@</TT> suffixed parameter belongs.</P>
+
+<P>For example, the parameter <TT>width@TypeHint</TT> applies to the <TT>width</TT> parameter and the <TT>./height@TypeHint</TT> parameter applies to the <TT>./height</TT> parameter. As can be seen, the correlation between the parameters is a simple case-sensitive string comparison. That is the <TT>widht@TypeHint</TT> parameter would not apply to the <TT>./width</TT> even though both parameters address the same property but they do not have a string match.</P>
+
+
+<H6><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-%7B%7B@TypeHint%7D%7D"></A><TT>@TypeHint</TT></H6>
+
+<P>Parameters with the <TT>@TypeHint</TT> suffix may be used to force storing the named parameter in a property with the given type. The value of the <TT>@TypeHint</TT> parameter, if applied to a parameter for a property, is the JCR property type name. If the <TT>@TypeHint</TT> parameter is applied to a field upload parameter, the value is used to indicate the JCR primary node type for the node into which the uploaded file is stored.</P>
+
+<P>If the <TT>@TypeHint</TT> ends with &quot;[]&quot;, it indicates a multi-value property. A multi-value property is usually auto-detected if there are mutliple values for the property (ie. request parameter). But if only a single value is present in the request, the desired property type needs to be explicitly defined as multi-value by stating <TT>@TypeHint=&lt;type&gt;[]</TT>.</P>
+
+<P>Example: The following form sets the numeric <TT>width</TT>, the boolean <TT>checked</TT>, and the multi-valued <TT>hobbys</TT> (with 3 values to enter) properties:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+<SPAN class="code-tag">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;/content/page/first&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;width&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;width@TypeHint&quot;</SPAN> value=<SPAN class="code-quote">&quot;Long&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;checkbox&quot;</SPAN> name=<SPAN class="code-quote">&quot;checked&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;checked@TypeHint&quot;</SPAN> value=<SPAN class="code-quote">&quot;Boolean&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;hobbys&quot;</SPAN>/&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;hobbys&quot;</SPAN>/&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;hobbys&quot;</SPAN>/&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;hobbys@TypeHint&quot;</SPAN> value=<SPAN class="code-quote">&quot;String[]&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;Submit&quot;</SPAN> /&gt;</SPAN>
+<SPAN class="code-tag">&lt;/form&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>In real applications you would need some javascript that allows to add/remove values, ie. add/remove inputs with the name &quot;hobbys&quot;. Or a pure javascript based form post would be used, that gathers the properties to update programmatically, but the additional parameter <TT>hobbys@TypeHint=String[]</TT> would be the same.</P>
+
+<P>The <TT>@TypeHint</TT> suffixed parameter is assumed to be single-valued. If the parameter has multiple values, only the first is actually used.</P>
+
+<P>For more information on applying <TT>@TypeHint</TT> to a file upload parameter see the section on File Uploads above.</P>
+
+
+<H6><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-%7B%7B@DefaultValue%7D%7D"></A><TT>@DefaultValue</TT></H6>
+
+
+<P>The <TT>@DefaultValue</TT> suffixed parameter may be provided to set a property to a default value should no value be provided in the actual parameters. Same as for normal parameters, the <TT>@DefaultValue</TT> parameter may have multiple values to create multi-valued properties.</P>
+
+<P>Example: Set the <TT>text</TT> property to a default value if the user does not provide one:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+<SPAN class="code-tag">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;/content/page/first&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;text&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;text@DefaultValue&quot;</SPAN> value=<SPAN class="code-quote">&quot;--- Default Value ---&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;Submit&quot;</SPAN> /&gt;</SPAN>
+<SPAN class="code-tag">&lt;/form&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+
+<H6><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-%7B%7B@UseDefaultWhenMissing%7D%7D"></A><TT>@UseDefaultWhenMissing</TT></H6>
+
+<P>As described above, <TT>@DefaultValue</TT> only takes effect if no value is provided for a particular parameter. However, in some cases, such as HTML checkboxes, this isn't sufficient because the parameter isn't submitted at all. To handle this scenario, you can use the <TT>@UseDefaultWhenMissing</TT> suffixed parameter.</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+<SPAN class="code-tag">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;/content/page/first&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input name=<SPAN class="code-quote">&quot;queryIgnoreNoise&quot;</SPAN> class=<SPAN class="code-quote">&quot;input&quot;</SPAN> type=<SPAN class="code-quote">&quot;checkbox&quot;</SPAN> value=<SPAN class="code-quote">&quot;true&quot;</SPAN>/&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;queryIgnoreNoise@DefaultValue&quot;</SPAN> value=<SPAN class="code-quote">&quot;false&quot;</SPAN>/&gt;</SPAN> 
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;queryIgnoreNoise@UseDefaultWhenMissing&quot;</SPAN> value=<SPAN class="code-quote">&quot;true&quot;</SPAN>/&gt;</SPAN>
+<SPAN class="code-tag">&lt;/form&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+
+<H6><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-%7B%7B@IgnoreBlanks%7D%7D"></A><TT>@IgnoreBlanks</TT></H6>
+
+<P>Sometimes a form client will supply empty parameter values resulting in content being created or modified. For example submitting this form:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+<SPAN class="code-tag">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;/content/page/first&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;stringProperty@TypeHint&quot;</SPAN> value=<SPAN class="code-quote">&quot;String[]&quot;</SPAN>/&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;stringProperty&quot;</SPAN> value=<SPAN class="code-quote">&quot;foo&quot;</SPAN>/&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;stringProperty&quot;</SPAN> value=<SPAN class="code-quote">&quot;bar&quot;</SPAN>/&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;stringProperty&quot;</SPAN> value=&quot;&quot;/&gt;</SPAN>
+<SPAN class="code-tag">&lt;/form&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>will result in multi-value String property being set to [ &quot;foo&quot;, &quot;bar&quot;, &quot;&quot; ]. Notice the blank value.</P>
+
+<P>Likewise submitting this form without a value entered:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+<SPAN class="code-tag">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;/content/page/first&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;stringProperty@TypeHint&quot;</SPAN> value=<SPAN class="code-quote">&quot;String&quot;</SPAN>/&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;stringProperty&quot;</SPAN> value=&quot;&quot;/&gt;</SPAN>
+<SPAN class="code-tag">&lt;/form&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>will result in the single-value String property being set to an empty string.</P>
+
+<P>To overcome this situation the <TT>@IgnoreBlanks</TT> suffix may be used to consider parameters with an empty string value to be ignored during processing. That is such parameter values would be treated as if they would not be supplied.</P>
+
+<P>Adding</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;stringProperty@IgnoreBlanks&quot;</SPAN> value=<SPAN class="code-quote">&quot;true&quot;</SPAN>/&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>to the above forms will cause the multi-value property be set to the two-element value [ &quot;foo&quot;, &quot;bar&quot; ] and to not modify the property at all in the second single-value example.</P>
+
+
+<H6><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-%7B%7B@ValueFrom%7D%7D"></A><TT>@ValueFrom</TT></H6>
+
+<P>In some situations, an HTML form with parameters may be reused to update content. But one or more form parameters may not comply with the names expected to be used for properties. In this case a parameter suffixed with <TT>@ValueFrom</TT> may be set containing the name of the parameter providing the actual data to be used.</P>
+
+<P>Example: To set the property <TT>text</TT> from a form element <TT>supplied_text</TT>, you might use the following form:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+<SPAN class="code-tag">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;/content/page/first&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;supplied_text&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;./text@ValueFrom&quot;</SPAN> value=<SPAN class="code-quote">&quot;supplied_text&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;Submit&quot;</SPAN> /&gt;</SPAN>
+<SPAN class="code-tag">&lt;/form&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>To prevent storing the additional paramaters in the repository you might want to use the prefixing mechanism as shown in the example above, where the <TT>@ValueFrom</TT> parameter is prefixed and thus the <TT>supplied_text</TT> parameter is not used for property setting.</P>
+
+<P>The <TT>@ValueFrom</TT> suffixed parameter is assumed to be single-valued. If the parameter has multiple values it is ignored completely.</P>
+
+<P>The <TT>@ValueFrom</TT> suffixed parameter is also special in that there must not be a correlated parameter without a suffix. Thus have parameters <TT>text</TT> and <TT>text@ValueFrom</TT> may have unexpected results.</P>
+
+
+<H6><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-%7B%7B@Delete%7D%7D"></A><TT>@Delete</TT></H6>
+
+<P>Sometimes it may be required to not set a property to a specific value but to just remove it while processing the content update request. One such situation is a property filled from one or more checkboxes in an HTML form. If none of the checkboxes are checked, no parameter is actually submitted for these checkboxes. Hence the SlingPostServlet will not touch this property and effectively leave it untouched, while the natural reaction would have been to remove the property.</P>
+
+<P>Here comes the <TT>@Delete</TT> suffixed parameter. This simply causes the indicated property be removed if it exists. If the property does not exist, nothing more happens. The actual value of the <TT>@Delete</TT> suffixed parameter does not care as long as the parameter is submitted.</P>
+
+<P>Example: To ensure the <TT>color</TT> property is actually removed if no color has been selected, you might use the following form:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+<SPAN class="code-tag">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;/content/page/first&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;checkbox&quot;</SPAN> name=<SPAN class="code-quote">&quot;color&quot;</SPAN> value=<SPAN class="code-quote">&quot;red&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;checkbox&quot;</SPAN> name=<SPAN class="code-quote">&quot;color&quot;</SPAN> value=<SPAN class="code-quote">&quot;green&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;checkbox&quot;</SPAN> name=<SPAN class="code-quote">&quot;color&quot;</SPAN> value=<SPAN class="code-quote">&quot;blue&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;color@Delete&quot;</SPAN> value=<SPAN class="code-quote">&quot;delete text&quot;</SPAN> /&gt;</SPAN><SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- actual value is ignored --&gt;</SPAN></SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;Submit&quot;</SPAN> /&gt;</SPAN>
+<SPAN class="code-tag">&lt;/form&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+
+<P>The <TT>@Delete</TT> suffixed parameter is also special in that there need not be a correlated parameter without a suffix. If both &ndash; a parameters <TT>text</TT> and <TT>text@Delete</TT> are set, the <TT>text</TT> property is first deleted and then filled with the new content.</P>
+
+<P>The <TT>@Delete</TT> suffixed parameter in fact calls for a sub-operation, which is executed after the node addressed by the request URL is created (if needed) but before any other tasks of content creattion and modification are done. Any item &ndash; this may be a property or a node, actually &ndash; addressed by the <TT>@Delete</TT> suffixed parameter is just removed if it exists. If the item does not exist, nothing happens.</P>
+
+
+
+<H6><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-%7B%7B@MoveFrom%7D%7D"></A><TT>@MoveFrom</TT></H6>
+
+<P>Now, that your bright and shiny content management application has great Flash-based file upload feature you will want to be able to use the pre-uploaded files for your content with the same request as when you upload other content. For example you might have a node storing some text and an illustration you uploaded as an image file.</P>
+
+<P>To support this kind of functionality, the <TT>@MoveFrom</TT> suffixed parameter may be set to the repository path of the node to where you uploaded the image file.</P>
+
+<P>Example: Your Flash-based file upload stored the file on the server at <TT>/tmp/upload/123</TT>. You now want to store this file along with a title and a text in a newly created node. The following form will be your friend:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+<SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- trailing slash generates a name for the new node --&gt;</SPAN></SPAN>
+<SPAN class="code-tag">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;/content/page/&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;image@MoveFrom&quot;</SPAN> value=<SPAN class="code-quote">&quot;/tmp/upload/123&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;title&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;text&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;Submit&quot;</SPAN> /&gt;</SPAN>
+<SPAN class="code-tag">&lt;/form&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>If there exists no repository item at the indicated path, nothing is done. If the item indicated by the <TT>@MoveFrom</TT> suffixed parameter already exists, it is replaced by the item addressed by the parameter value &ndash; unless of course there is no item at the named location.</P>
+
+<P>The <TT>@MoveFrom</TT> suffixed parameter is assumed to be single-valued. If the parameter has multiple values it is ignored completely.</P>
+
+<P>The <TT>@MoveFrom</TT> suffixed parameter is also special in that there must not be a correlated parameter without a suffix. Thus have parameters <TT>text</TT> and <TT>text@MoveFrom</TT> may have unexpected results.</P>
+
+<P>The <TT>@MoveFrom</TT> suffixed parameter in fact calls for a sub-operation, which is executed after the <TT>@Delete</TT> sub operation but before any other tasks of content creattion and modification are done.</P>
+
+
+<H6><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-%7B%7B@CopyFrom%7D%7D"></A><TT>@CopyFrom</TT></H6>
+
+<P>Similar to the <TT>@MoveFrom</TT> suffix exists a <TT>@CopyFrom</TT> suffix. The latter works exactly the same as the former except that the item addressed by the parameter value is not moved but just copied.</P>
+
+<P>Example: Your Flash-based file upload stored the file on the server at <TT>/tmp/upload/123</TT>. You now want to store this file along with a title and a text in a newly created node. The following form may be your friend:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+<SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- trailing slash generates a name for the new node --&gt;</SPAN></SPAN>
+<SPAN class="code-tag">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;/content/page/&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;image@CopyFrom&quot;</SPAN> value=<SPAN class="code-quote">&quot;/tmp/upload/123&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;title&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;text&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;Submit&quot;</SPAN> /&gt;</SPAN>
+<SPAN class="code-tag">&lt;/form&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>If there exists no repository item at the indicated path, nothing is done. If the item indicated by the <TT>@CopyFrom</TT> suffixed parameter already exists, it is replaced by the item addressed by the parameter value &ndash; unless of course there is no item at the named location.</P>
+
+<P>The <TT>@CopyFrom</TT> suffixed parameter is assumed to be single-valued. If the parameter has multiple values it is ignored completely.</P>
+
+<P>The <TT>@CopyFrom</TT> suffixed parameter is also special in that there must not be a correlated parameter without a suffix. Thus have parameters <TT>text</TT> and <TT>text@CopyFrom</TT> may have unexpected results.</P>
+
+<P>The <TT>@CopyFrom</TT> suffixed parameter in fact calls for a sub-operation, which is executed after the <TT>@MoveFrom</TT> sub operation but before any other tasks of content creattion and modification are done.</P>
+
+
+
+<H5><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-AlgorithmforNodeNameCreation"></A>Algorithm for Node Name Creation</H5>
+
+<P>If request is posted with an URL ending in slash <TT>/</TT> or slash-star <TT>/*</TT>, the SlingPostServlet derives a name for the node to be created upon the request applying the following algorithm:</P>
+
+
+<OL>
+	<LI>If a <TT>:name</TT> parameter is supplied, the (first) value of this parameter is used unmodified as the name for the new node. If the name is illegally formed with respect to JCR name requirements, an exception will be thrown when trying to create the node. The assumption with the <TT>:name</TT> parameter is, that the caller knows what he (or she) is supplying and should get the exact result if possible.</LI>
+	<LI>Otherwise if a <TT>:nameHint</TT> parameter is supplied, the (first) value of this parameter is used to generate the node name. A name filtering is applied to this hint to ensure a valid JCR node name.</LI>
+	<LI>Otherwise a series of request paramaters supplied to set content is inspected for a possible name. The list of the names of these parameter is configurable with the SlingPostServlet and defaults ot <TT>[ title, jcr:title, name, description, jcr:description, abstract ]</TT>. The first request parameter with a non-empty value is used and filtered to get the valid JCR name.</LI>
+	<LI>Otherwise an ever increasing auto generated number is used. Filtering is also applied to this numeric name.</LI>
+</OL>
+
+
+
+<P>The filtering algorithm to create a valid name of the hints from above steps (except the first) works as follows:</P>
+
+<UL>
+	<LI>Convert the proposed name to all lower case.</LI>
+	<LI>Replace all characters not in the range [0..9a..z_] by a single underscore <TT>&#95;</TT>.</LI>
+	<LI>If the name starts with a digit prepend an underscore. Technically names with leading digits are valid, but they present major issues when using such names in JCR XPath expressions. The algorithm takes care to not create names with two or more consecutive underscore characters.</LI>
+	<LI>Finally the name is cut to a configurable maximum length (default is 20 characters).</LI>
+</UL>
+
+
+
+<P>For example the <TT>:nameHint</TT> value <EM>A quick brown Fox ...</EM> is filtered to become <EM>a&#95;quick&#95;brown&#95;fox&#95;</EM></P>
+
+<P>After generating and filtering the name it is further guaranteed that the name is unique: If a node of the same name as just generated from the algorithm already exists below the same parent node a numeric index is appended to the new node name to make it unique.</P>
+
+
+<H5><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-ResponseStatus"></A>Response Status</H5>
+
+<P>The modification operation has the following status responses:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Explanation </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> 200/OK </TD>
+<TD class="confluenceTd"> An existing node has been updated with content </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 201/CREATED </TD>
+<TD class="confluenceTd"> A new node has been created and filled with content </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 500/INTERNAL SERVER ERROR </TD>
+<TD class="confluenceTd"> Some exception, for example a <TT>RepositoryException</TT>, occurred while processing the request </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+<H3><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-ContentRemoval"></A>Content Removal</H3>
+
+<P>To remove existing content just address the item to be removed and set the <TT>:operation</TT> parameter to <TT>delete</TT>. For example the following command line removes the <TT>/content/sample</TT> page:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ curl -F&quot;:operation=delete&quot; http://host/content/sample
+</PRE>
+</DIV></DIV>
+
+
+<H5><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-ResponseStatus"></A>Response Status</H5>
+
+<P>The delete operation has the following status responses:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Explanation </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> 200/OK </TD>
+<TD class="confluenceTd"> The resource (and all its descendents) has been removed </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 404/NOT FOUND </TD>
+<TD class="confluenceTd"> The request URL does not address an existing repository item </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 500/INTERNAL SERVER ERROR </TD>
+<TD class="confluenceTd"> Some exception, for example a <TT>RepositoryException</TT>, occurred while processing the request </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+
+<H5><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-DeletingMultipleItems"></A>Deleting Multiple Items</H5>
+
+<P>By using the <TT>:applyTo</TT> request parameter it is possible to remove multiple items in one single request. Deleting items in this way leaves you with less control, though. In addition, if a single item removal fails, no item at all is removed.</P>
+
+<P>When specifying the item(s) to be removed with the <TT>:applyTo</TT> parameter, the request resource is left untouched (unless of course if listed in the <TT>:applyTo</TT> parameter) and only used to resolve any relative paths in the <TT>:applyTo</TT> parameter.</P>
+
+<P>To remove the <TT>/content/page1</TT> and <TT>/content/page2</TT> nodes, for example, you might use the following command line:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ curl -F&quot;:operation=delete&quot; -F&quot;:applyTo=/content/page1&quot; -F&quot;:applyTo=/content/page2&quot; http://host/content/sample
+</PRE>
+</DIV></DIV>
+
+<P>Using a trailing star in the :applyTo parameter (as mentioned before), you can remove all the children of the <TT>/content</TT> node, for example, as follows:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ curl -F&quot;:operation=delete&quot; -F&quot;:applyTo=/content/*&quot; http://host/content/sample
+</PRE>
+</DIV></DIV>
+
+<P>If any resource listed in the <TT>:applyTo</TT> parameter does not exist, it is silently ignored.</P>
+
+<H6><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-ResponseStatus"></A>Response Status</H6>
+
+<P>The delete operation applied to multiple resources has the following status responses:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Explanation </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> 200/OK </TD>
+<TD class="confluenceTd"> All requested and existing resources have been removed </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 500/INTERNAL SERVER ERROR </TD>
+<TD class="confluenceTd"> Some exception, for example a <TT>RepositoryException</TT>, occurred while processing the request </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+
+<H3><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-CopyingContent"></A>Copying Content</H3>
+
+
+<P>To copy existing content to a new location, the <TT>copy</TT> operation is specified. This operation copies the item addressed by the request URL to a new location indicated by the <TT>:dest</TT> parameter. The <TT>:dest</TT> parameter is the absolute or relative path to which the resource is copied. If the path is relative it is assumed to be below the same parent as the request resource. If it is terminated with a <TT>/</TT> character the request resource is copied to an item of the same name under the destination path.</P>
+
+<P>To illustrate the <TT>:dest</TT> parameter handling, lets look at a few examples. All examples are based on addressing the <TT>/content/sample</TT> item:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> <TT>:dest</TT> Parameter </TH>
+<TH class="confluenceTh"> Destination Absolute Path </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/newSample</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/newSample</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>different/newSample</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/different/newSample</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/different/</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/different/sample</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>different/</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/different/sample</TT> </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+<P>If an item already exists at the location derived from the <TT>:dest</TT> parameter, the copy operation fails unless the <TT>:replace</TT> parameter is set to <TT>true</TT> (case is ignored when checking the parameter value).</P>
+
+
+
+<H5><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-ResponseStatus"></A>Response Status</H5>
+
+<P>The copy operation has the following status responses:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Explanation </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> 200/OK </TD>
+<TD class="confluenceTd"> The node has been copied to the new location replacing an existing item at the destination </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 201/CREATED </TD>
+<TD class="confluenceTd"> The node has been copied to the new location creating a new item at the destination </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 404/NOT FOUND </TD>
+<TD class="confluenceTd"> The request URL does not address an existing repository item </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 412/PRECONDITION FAILED </TD>
+<TD class="confluenceTd"> An item already exists at the destination and the <TT>:replace</TT> parameter is not set to <TT>true</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 500/INTERNAL SERVER ERROR </TD>
+<TD class="confluenceTd"> Some exception, for example a <TT>RepositoryException</TT>, occurred while processing the request </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+
+<H5><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-CopyingMultipleItems"></A>Copying Multiple Items</H5>
+
+<P>By using the <TT>:applyTo</TT> request parameter it is possible to copy multiple items in one single request. Copying items in this way leaves you with less control, though. In addition, if a single item copy fails, no item at all is copied.</P>
+
+<P>When specifying the item(s) to be copied with the <TT>:applyTo</TT> parameter, the request resource is left untouched (unless of course if listed in the <TT>:applyTo</TT> parameter) and only used to resolve any relative paths in the <TT>:applyTo</TT> parameter.</P>
+
+<P>To copy the <TT>/content/page1</TT> and <TT>/content/page2</TT> nodes to <TT>/content/target</TT>, for example, use:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ curl -F&quot;:operation=copy&quot; -F&quot;:applyTo=/content/page1&quot; -F&quot;:applyTo=/content/page2&quot; -F&quot;:dest=/content/target/&quot; http://host/content/sample
+</PRE>
+</DIV></DIV>
+
+<P>Please note the trailing slash character (<TT>/</TT>) in the value of the <TT>:dest</TT> parameter. This is required for multi-item copy operations using the <TT>:applyTo</TT> parameter. The copied items are created below the node indicated by the <TT>:dest</TT>.</P>
+
+<P>Using a trailing star in the :applyTo parameter (as mentioned before), you can copy all the children of the <TT>/content</TT> node, for example, as follows:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ curl -F&quot;:operation=copy&quot; -F&quot;:applyTo=/content/*&quot; -F&quot;:dest=/content/target/&quot; http://host/content/sample
+</PRE>
+</DIV></DIV>
+
+<P>If any resource listed in the <TT>:applyTo</TT> parameter does not exist, it is silently ignored. Any item already existing at the copy destination whose name is the same as the name of an item to be copied is silently overwritten with the source item.</P>
+
+<H6><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-ResponseStatus"></A>Response Status</H6>
+
+<P>The copy operation applied to multiple resources has the following status responses:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Explanation </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> 200/OK </TD>
+<TD class="confluenceTd"> All requested and existing resources have been copied </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 412/PRECONDITION FAILED </TD>
+<TD class="confluenceTd"> The node indicated by the <TT>:dest</TT> parameter does not exist </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 500/INTERNAL SERVER ERROR </TD>
+<TD class="confluenceTd"> Some exception, for example a <TT>RepositoryException</TT>, occurred while processing the request. This status is also set if the <TT>:dest</TT> parameter value does not have a trailing slash character. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+
+
+
+<H3><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-MovingContent"></A>Moving Content</H3>
+
+
+<P>To move existing content to a new location, the <TT>move</TT> operation is specified. This operation moves the item addressed by the request URL to a new location indicated by the <TT>:dest</TT> parameter. The <TT>:dest</TT> parameter is the absolute or relative path to which the resource is moved. If the path is relative it is assumed to be below the same parent as the request resource. If it is terminated with a <TT>/</TT> character the request resource is moved to an item of the same name under the destination path.</P>
+
+<P>To illustrate the <TT>:dest</TT> parameter handling, lets look at a few examples. All examples are based on addressing the <TT>/content/sample</TT> item:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> <TT>:dest</TT> Parameter </TH>
+<TH class="confluenceTh"> Destination Absolute Path </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/newSample</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/newSample</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>different/newSample</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/different/newSample</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>/content/different/</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/different/sample</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>different/</TT> </TD>
+<TD class="confluenceTd"> <TT>/content/different/sample</TT> </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+<P>If an item already exists at the location derived from the <TT>:dest</TT> parameter, the move operation fails unless the <TT>:replace</TT> parameter is set to <TT>true</TT> (case is ignored when checking the parameter value).</P>
+
+
+
+<H5><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-ResponseStatus"></A>Response Status</H5>
+
+<P>The move operation has the following status responses:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Explanation </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> 200/OK </TD>
+<TD class="confluenceTd"> The node has been moved to the new location replacing an existing item at the destination </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 201/CREATED </TD>
+<TD class="confluenceTd"> The node has been moved to the new location creating a new item at the destination </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 404/NOT FOUND </TD>
+<TD class="confluenceTd"> The request URL does not address an existing repository item </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 412/PRECONDITION FAILED </TD>
+<TD class="confluenceTd"> An item already exists at the destination and the <TT>:replace</TT> parameter is not set to <TT>true</TT> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 500/INTERNAL SERVER ERROR </TD>
+<TD class="confluenceTd"> Some exception, for example a <TT>RepositoryException</TT>, occurred while processing the request </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+
+<H5><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-MovingMultipleItems"></A>Moving Multiple Items</H5>
+
+<P>By using the <TT>:applyTo</TT> request parameter it is possible to move multiple items in one single request. Moving items in this way leaves you with less control, though. In addition, if a single item move fails, no item at all is moved.</P>
+
+<P>When specifying the item(s) to be moved with the <TT>:applyTo</TT> parameter, the request resource is left untouched (unless of course if listed in the <TT>:applyTo</TT> parameter) and only used to resolve any relative paths in the <TT>:applyTo</TT> parameter.</P>
+
+<P>To for example move the <TT>/content/page1</TT> and <TT>/content/page2</TT> nodes to <TT>/content/target</TT>, you might use the following command line:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ curl -F&quot;:operation=move&quot; -F&quot;:applyTo=/content/page1&quot; -F&quot;:applyTo=/content/page2&quot; -F&quot;:dest=/content/target/&quot; http://host/content/sample
+</PRE>
+</DIV></DIV>
+
+<P>Please note the trailing slash character (<TT>/</TT>) in the value of the <TT>:dest</TT> parameter. This is required for multi-item move operations using the <TT>:applyTo</TT> parameter. The moved items are created below the node indicated by the <TT>:dest</TT>.</P>
+
+<P>Using a trailing star in the :applyTo parameter (as mentioned before), you can move all the children of the <TT>/content</TT> node, for example, as follows:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ curl -F&quot;:operation=move&quot; -F&quot;:applyTo=/content/*&quot; -F&quot;:dest=/content/target/&quot; http://host/content/sample
+</PRE>
+</DIV></DIV>
+
+<P>If any resource listed in the <TT>:applyTo</TT> parameter does not exist, it is silently ignored. Any item already existing at the move destination whose name is the same as the name of an item to be moved is silently overwritten with the source item.</P>
+
+<H6><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-ResponseStatus"></A>Response Status</H6>
+
+<P>The move operation applied to multiple resources has the following status responses:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Explanation </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> 200/OK </TD>
+<TD class="confluenceTd"> All requested and existing resources have been moved </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 412/PRECONDITION FAILED </TD>
+<TD class="confluenceTd"> The node indicated by the <TT>:dest</TT> parameter does not exist </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 500/INTERNAL SERVER ERROR </TD>
+<TD class="confluenceTd"> Some exception, for example a <TT>RepositoryException</TT>, occurred while processing the request. This status is also set if the <TT>:dest</TT> parameter value does not have a trailing slash character. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+
+
+<H3><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-ImportingContentStructures"></A>Importing Content Structures</H3>
+
+<P>To import content structures just address the parent item to import into and set the <TT>:operation</TT> parameter to <TT>import</TT>. </P>
+
+<P>The optional name of the root node of the imported content may optionally be supplied using the <A href="#ManipulatingContent-TheSlingPostServlet%2528servlets.post%2529-AlgorithmforNodeNameCreation">Algorithm for Node Name Creation</A>.</P>
+
+<P>Other parameters for the import operation:</P>
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Parameter </TH>
+<TH class="confluenceTh"> Required </TH>
+<TH class="confluenceTh"> Default value </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>:contentType</TT> </TD>
+<TD class="confluenceTd"> <TT>true</TT> </TD>
+<TD class="confluenceTd">&nbsp;</TD>
+<TD class="confluenceTd"> The <TT>:contentType</TT> value specifies the type of content being imported.  Possible values are: xml, jcr.xml, json, jar, zip </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>:content</TT> </TD>
+<TD class="confluenceTd"> <TT>false</TT> </TD>
+<TD class="confluenceTd">&nbsp;</TD>
+<TD class="confluenceTd"> The <TT>:content</TT> value specifies content string to import. The format of the import content is the same as is used by the jcr.contentloader bundle.  This parameter is required if the :contentFile parameter is not supplied. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>:contentFile</TT> </TD>
+<TD class="confluenceTd"> <TT>false</TT> </TD>
+<TD class="confluenceTd">&nbsp;</TD>
+<TD class="confluenceTd"> The <TT>:contentFile</TT> value specifies a file uploaded for import. The format of the import content is the same as is used by the jcr.contentloader bundle.  This parameter is required if the :content parameter is not supplied. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>:checkin</TT> </TD>
+<TD class="confluenceTd"> <TT>false</TT> </TD>
+<TD class="confluenceTd"> false </TD>
+<TD class="confluenceTd"> The <TT>:checkin</TT> value specifies whether versionable nodes should be checked in during the import. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>:autoCheckout</TT> </TD>
+<TD class="confluenceTd"> <TT>false</TT> </TD>
+<TD class="confluenceTd"> false </TD>
+<TD class="confluenceTd"> The <TT>:autoCheckout</TT> value specifies whether versionable nodes should be checked out when necessary during the import. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>:replace</TT> </TD>
+<TD class="confluenceTd"> <TT>false</TT> </TD>
+<TD class="confluenceTd"> false </TD>
+<TD class="confluenceTd"> The <TT>:replace</TT> value specifies whether the import should replace any existing nodes at the same path. Note: When true, the existing nodes will be deleted and a new node is created in the same place. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>:replaceProperties</TT> </TD>
+<TD class="confluenceTd"> <TT>false</TT> </TD>
+<TD class="confluenceTd"> false </TD>
+<TD class="confluenceTd"> The <TT>:replaceProperties</TT> value specifies whether the import should replace properties if they already exist. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+<P>For example the following command line imports the <TT>/content/sample</TT> page:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ curl -F&quot;:operation=import&quot; -F&quot;:contentType=json&quot; -F&quot;:name=sample&quot; 
+   -F&quot;:content={ 'jcr:primaryType': 'nt:unstructured', 'propOne' : 'propOneValue', 'childOne' : { 'childPropOne' : true } }&quot; http://host/content
+</PRE>
+</DIV></DIV>
+
+<P>For example the following command line imports the <TT>/content/sample</TT> page without the optional name parameter:</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ curl -F&quot;:operation=import&quot; -F&quot;:contentType=json&quot;
+   -F&quot;:content={ 'sample' : {'propOne' : 'propOneValue', 'childOne' : { 'childPropOne' : true } } }&quot; http://host/content
+</PRE>
+</DIV></DIV>
+
+<P>For example the following form imports the <TT>/content/sample</TT> page:</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+<SPAN class="code-tag">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;/content&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;:operation&quot;</SPAN> value=<SPAN class="code-quote">&quot;import&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;:contentType&quot;</SPAN> value=<SPAN class="code-quote">&quot;json&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;:nameHint&quot;</SPAN> value=<SPAN class="code-quote">&quot;sample&quot;</SPAN> /&gt;</SPAN>
+
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;text&quot;</SPAN> name=<SPAN class="code-quote">&quot;:content&quot;</SPAN> value=<SPAN class="code-quote">&quot;{ 'jcr:primaryType': 'nt:unstructured', 'propOne' : 'propOneValue', 'childOne' : { 'childPropOne' : true } }&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;Submit&quot;</SPAN> /&gt;</SPAN>
+<SPAN class="code-tag">&lt;/form&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>For example the following form imports content from a file upload:</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-html">
+<SPAN class="code-tag">&lt;form method=<SPAN class="code-quote">&quot;POST&quot;</SPAN> action=<SPAN class="code-quote">&quot;/content&quot;</SPAN> enctype=<SPAN class="code-quote">&quot;multipart/form-data&quot;</SPAN>&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;:operation&quot;</SPAN> value=<SPAN class="code-quote">&quot;import&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;:contentType&quot;</SPAN> value=<SPAN class="code-quote">&quot;json&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;hidden&quot;</SPAN> name=<SPAN class="code-quote">&quot;:nameHint&quot;</SPAN> value=<SPAN class="code-quote">&quot;sample&quot;</SPAN> /&gt;</SPAN>
+
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;file&quot;</SPAN> name=<SPAN class="code-quote">&quot;:contentFile&quot;</SPAN> /&gt;</SPAN>
+    <SPAN class="code-tag">&lt;input type=<SPAN class="code-quote">&quot;Submit&quot;</SPAN> /&gt;</SPAN>
+<SPAN class="code-tag">&lt;/form&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<H6><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-ResponseStatus"></A>Response Status</H6>
+
+<P>The move operation applied to multiple resources has the following status responses:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Explanation </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> 200/OK </TD>
+<TD class="confluenceTd"> All requested content has been imported </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 404/NOT FOUND </TD>
+<TD class="confluenceTd"> The target parent node does not exist </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 412/PRECONDITION FAILED </TD>
+<TD class="confluenceTd"> One or more of the required parameters does not exist </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> 500/INTERNAL SERVER ERROR </TD>
+<TD class="confluenceTd"> Some exception, for example a <TT>RepositoryException</TT>, occurred while processing the request. This status is also set if the ContentImporter service is missing. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<H3><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-NullOperation"></A>Null Operation</H3>
+
+<P>Sometimes it is useful to explicitly request that nothing is to be done. The SlingPostServlet now provides such an operation under the name <TT>nop</TT>. Apart from doing nothing, the <TT>nop</TT> operations sets the response status to either the default <TT>200/OK</TT> or to any status requested by the <TT>:nopstatus</TT> request parameter.</P>
+
+<P>The <TT>:nopstatus</TT> request parameter must be an integral number in the range [ 100 .. 999 ]. If the parameter value cannot be parsed to an integer or the value is outside of this range, the default status <TT>200/OK</TT> is still set.</P>
+
+
+<H6><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-ResponseStatus"></A>Response Status</H6>
+
+<P>The null operation sets a default status or the status requested by the <TT>:nopstatus</TT> request parameter.</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Status </TH>
+<TH class="confluenceTh"> Explanation </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> 200/OK </TD>
+<TD class="confluenceTd"> Default status set if <TT>:nopstatus</TT> parameter is not set or does not have a valid value </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> {:nopstatus} </TD>
+<TD class="confluenceTd"> The status as requested by the <TT>:nopstatus</TT> parameter </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+
+<H2><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-SpecialParameters"></A>Special Parameters</H2>
+
+
+<P>Some parameters have special significance for the complete processing of the SlingPostServlet or are used by multiple operations. This section summarizes these parameters:</P>
+
+
+<H3><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-%7B%7B%3Aorder%7D%7D"></A><TT>:order</TT></H3>
+
+<P>Child nodes may be ordered if the primary node type of their common parent node is defined as having orderable child nodes. To employ such ordering, the content creation/modification, move and copy operations support the <TT>:order</TT> parameter which apply child node ordering amongst its siblings of the target node.</P>
+
+<P>The <TT>:order</TT> parameter may have the following values:</P>
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Value </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>first</TT> </TD>
+<TD class="confluenceTd"> Place the target node as the first amongst its siblings </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>last</TT> </TD>
+<TD class="confluenceTd"> Place the target node as the last amongst its siblings </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>before <EM>xyz</EM></TT> </TD>
+<TD class="confluenceTd"> Place the target node immediately before the sibling whose name is <EM>xyz</EM> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> <TT>after <EM>xyz</EM></TT> </TD>
+<TD class="confluenceTd"> Place the target node immediately after the sibling whose name is <EM>xyz</EM> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> numeric </TD>
+<TD class="confluenceTd"> Place the target node at the indicated numeric place amongst its siblings where <EM>0</EM> is equivalent to <TT>first</TT> and <EM>1</EM> means the second place </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+
+
+<P>Note that simple content reordering can be requested without applying any other operations. This is easiest done by placing a request to the resource to be reordered and just setting the <TT>:order</TT> parameter. For example to order the <TT>/content/sample/page5</TT> resource above its sibling resource <TT>/content/sample/other</TT> a simple request</P>
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>$ curl -F&quot;:order=before other&quot; http://host/content/sample/page5
+</PRE>
+</DIV></DIV>
+
+<P>does the trick. To be redirected after the reodering, the <TT>:redirect</TT> parameter may optionally also be specified.</P>
+
+
+<H3><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-%7B%7B%3Aredirect%7D%7D"></A><TT>:redirect</TT></H3>
+
+<P>Instructs the SlingPostServlet to redirect the client to the indicated location if the operation succeeds. That is the reponse status is set to <EM>302/FOUND</EM> and the <TT>Location</TT> header is set to the value of the <TT>:redirect</TT> parameter.</P>
+
+
+<H3><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-%7B%7B%3Astatus%7D%7D"></A><TT>:status</TT></H3>
+
+<P>By default the SlingPostServlet sets response status according to the status of the operation executed. In some cases, it may be desirable to not have the real status codes (e.g. 404 or 505) but a normal <EM>200/OK</EM> to trick the client browser into displaying the response content generated by the SlingPostServlet.</P>
+
+<P>To not send the actual response status back to the client, the <TT>:status</TT> request parameter should be set to <TT>browser</TT>. If this parameter is not set, is empty, is set to <TT>standard</TT> or to any other value, the actual status code is sent back to the client.</P>
+
+<H2><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-Responseformat"></A>Response format</H2>
+
+<P>The SlingPostServlet produces a basic HTTP response body, listing the response status, what changes have been made, and other meta-data about the result of the POST request.</P>
+
+<P>The format of this response is either HTML or JSON (JSON support introduced with <A href="https://issues.apache.org/jira/browse/SLING-1336" class="external-link" rel="nofollow">SLING-1336</A>). SlingPostServlet determines which format to use by examining the Accept header of the incoming request. If the client has specified a preference for the media type &quot;application/json&quot;, the JSON format is used, otherwise HTML is returned.<BR>
+The Accept header can be overridden (and simulated) by posting a :http-equiv-accept field, which should have the same format as the Accept header.</P>
+
+<P>Examples:</P>
+<OL>
+	<LI>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*<B>/</B>*;q=0.8</LI>
+	<LI>Accept: application/json,*<B>/</B>*;q=0.9</LI>
+</OL>
+
+
+<P>In example #1, SlingPostServlet will return HTML, since the client has specified a preference for text/html. In example #2, SlingPostServlet will return JSON.</P>
+
+<P>See <A href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1" class="external-link" rel="nofollow">RFC 2616, section 14.1</A> for information on the HTTP Accept header.</P>
+
+<H2><A name="ManipulatingContent-TheSlingPostServlet%28servlets.post%29-VersionableNodeSupport"></A>Versionable Node Support</H2>
+

[... 47 lines stripped ...]