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 2015/03/15 21:48:10 UTC
svn commit: r943886 - in /websites/staging/sling/trunk/content: ./
documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html
Author: buildbot
Date: Sun Mar 15 20:48:10 2015
New Revision: 943886
Log:
Staging update by buildbot for sling
Modified:
websites/staging/sling/trunk/content/ (props changed)
websites/staging/sling/trunk/content/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html
Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sun Mar 15 20:48:10 2015
@@ -1 +1 @@
-1666372
+1666841
Modified: websites/staging/sling/trunk/content/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html (original)
+++ websites/staging/sling/trunk/content/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html Sun Mar 15 20:48:10 2015
@@ -168,7 +168,7 @@
</div>
<h2 id="multiple-ways-to-modify-content">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>
+<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 id="quickstart-creating-content">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="codehilite"><pre><span class="nt"><form</span> <span class="na">method=</span><span class="s">"POST"</span> <span class="na">action=</span><span class="s">"http://host/some/new/content"</span> <span class="na">enctype=</span><span class="s">"multipart/form-data"</span><span class="nt">></span>
@@ -179,18 +179,18 @@
<p>This simple form will set the <code>title</code> and <code>text</code> properties on a node at <code>/some/new/content</code>. 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 <code>curl</code> command line tool:</p>
+<p>Similarly, you can do this using the <code>curl</code> command line tool:</p>
<div class="codehilite"><pre>$ <span class="n">curl</span> <span class="o">-</span><span class="n">Ftitle</span><span class="p">=</span>"<span class="n">some</span> <span class="n">title</span> <span class="n">text</span>" <span class="o">-</span><span class="n">Ftext</span><span class="p">=</span>"<span class="n">some</span> <span class="n">body</span> <span class="n">text</span> <span class="n">content</span>" <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">host</span><span class="o">/</span><span class="n">some</span><span class="o">/</span><span class="n">new</span><span class="o">/</span><span class="n">content</span>
</pre></div>
-<p>You might want to use a specific JCR node type for a newly created node. This is possibly by simply setting a <code>jcr:primaryType</code> property on the request, e.g.</p>
+<p>You might want to use a specific JCR node type for a newly created node. This is possible by simply setting a <code>jcr:primaryType</code> property on the request, e.g.</p>
<div class="codehilite"><pre>$ <span class="n">curl</span> <span class="o">-</span><span class="n">F</span>"<span class="n">jcr</span><span class="p">:</span><span class="n">primaryType</span><span class="p">=</span><span class="n">nt</span><span class="p">:</span><span class="n">unstructured</span>" <span class="o">-</span><span class="n">Ftitle</span><span class="p">=</span>"<span class="n">some</span> <span class="n">title</span> <span class="n">text</span>" <span class="o">\</span>
<span class="o">-</span><span class="n">Ftext</span><span class="p">=</span>"<span class="n">some</span> <span class="n">body</span> <span class="n">text</span> <span class="n">content</span>" <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">host</span><span class="o">/</span><span class="n">some</span><span class="o">/</span><span class="n">new</span><span class="o">/</span><span class="n">content</span>
</pre></div>
-<p>Similary you may assing JCR mixin node types using the <code>jcr:mixinTypes</code> property and a Sling resource type using the <code>sling:resourceType</code> property. For example:</p>
+<p>Similarly, you may assign JCR mixin node types using the <code>jcr:mixinTypes</code> property and a Sling resource type using the <code>sling:resourceType</code> property. For example:</p>
<div class="codehilite"><pre>$ <span class="n">curl</span> <span class="o">-</span><span class="n">F</span>"<span class="n">sling</span><span class="p">:</span><span class="n">resourceType</span><span class="p">=</span><span class="n">sling</span><span class="p">:</span><span class="n">sample</span>" <span class="o">-</span><span class="n">Ftitle</span><span class="p">=</span>"<span class="n">some</span> <span class="n">title</span> <span class="n">text</span>" <span class="o">\</span>
<span class="o">-</span><span class="n">Ftext</span><span class="p">=</span>"<span class="n">some</span> <span class="n">body</span> <span class="n">text</span> <span class="n">content</span>" <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">host</span><span class="o">/</span><span class="n">some</span><span class="o">/</span><span class="n">new</span><span class="o">/</span><span class="n">content</span>
</pre></div>
@@ -198,10 +198,10 @@
<h2 id="preface-multipartform-data-posts">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 <code>multipart/form-data</code> encoding. This preserves the order of parameter application according to the original HTML form. To this avail ensure to always include the <code>enctype="multipart/form-data"</code> attribute with the <code><form></code> tag.</p>
+<p>In this case, ensure you are submitting the POST request using <code>multipart/form-data</code> encoding. This preserves the order of parameter application according to the original HTML form. To this avail, ensure to always include the <code>enctype="multipart/form-data"</code> attribute with the <code><form></code> tag.</p>
<p>This support requires Sling Engine 2.1.0 and the Sling Default Post Servlet 2.0.6.</p>
<h2 id="slingpostservlet-operations">SlingPostServlet Operations</h2>
-<p>The SlingPostServlet is actually just a frontend to the actual operations. To select the actual operation to execute, the <code>:operation</code> request parameter is used. Out of the box, the SlingPostServlet supports the following operations:</p>
+<p>The SlingPostServlet is actually just a front-end to the actual operations. To select the actual operation to execute, the <code>:operation</code> request parameter is used. Out of the box, the SlingPostServlet supports the following operations:</p>
<ul>
<li>property not set or empty -- Create new content or modify existing content</li>
<li><code>delete</code> -- Remove existing content</li>
@@ -284,7 +284,7 @@ of a resource without having to specify
</pre></div>
-<p>If this form is submitted with <em>title</em> and <em>This is some Text</em> as values for the <code>title</code> and <code>text</code> fields, resp., a new node is created at the path <code>/content/page/first</code> and the <code>title</code> and <code>text</code> properties set to the respective field values. If a node at <code>/content/page/first</code> already existed before submitting the form, the <code>title</code> and <code>text</code> properties are just updated to the new values from the form fields.</p>
+<p>If this form is submitted with <em>title</em> and <em>This is some Text</em> as values for the <code>title</code> and <code>text</code> fields respectively, a new node is created at the path <code>/content/page/first</code> and the <code>title</code> and <code>text</code> properties set to the respective field values. If a node at <code>/content/page/first</code> already existed before submitting the form, the <code>title</code> and <code>text</code> 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="codehilite"><pre>$ <span class="n">curl</span> <span class="o">-</span><span class="n">Fmulti</span><span class="p">=</span><span class="n">one</span> <span class="o">-</span><span class="n">Fmulti</span><span class="p">=</span><span class="n">two</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">host</span><span class="o">/</span><span class="n">content</span><span class="o">/</span><span class="n">page</span>
</pre></div>
@@ -327,7 +327,7 @@ of a resource without having to specify
<h5 id="date-properties">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 <code>Calendar</code> objects.</p>
<p>The Sling Post Servlet configuration property <code>servlet.post.dateFormats</code> takes a list of format strings which are used to setup <code>java.text.SimpleDateFormat</code> instances for parsing date/time string representations. A special format string <code>ISO8601</code> 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>
+<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, using the org.apache.jackrabbit.util.ISO8601 parser (±YYYY-MM-DDThh:mm:ss.SSSTZD)</li>
@@ -339,7 +339,7 @@ of a resource without having to specify
</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 <code>Date</code> -- and thus a <code>Calendar</code> -- object is used. Therefore this list is best ordered in a most-stringent to least-stringent order.</p>
<h5 id="omitting-some-parameters">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 (<code>./</code>).</p>
+<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 (<code>./</code>).</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 (<code>../</code>) and slash (<code>/</code>) 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="codehilite"><pre><span class="nt"><form</span> <span class="na">method=</span><span class="s">"POST"</span> <span class="na">action=</span><span class="s">"/content/page/first"</span> <span class="na">enctype=</span><span class="s">"multipart/form-data"</span><span class="nt">></span>
@@ -367,7 +367,7 @@ of a resource without having to specify
<p>For example, the parameter <code>width@TypeHint</code> applies to the <code>width</code> parameter and the <code>./height@TypeHint</code> parameter applies to the <code>./height</code> parameter. As can be seen, the correlation between the parameters is a simple case-sensitive string comparison. That is the <code>widht@TypeHint</code> parameter would not apply to the <code>./width</code> even though both parameters address the same property but they do not have a string match.</p>
<h6 id="typehint"><code>@TypeHint</code></h6>
<p>Parameters with the <code>@TypeHint</code> suffix may be used to force storing the named parameter in a property with the given type. The value of the <code>@TypeHint</code> parameter, if applied to a parameter for a property, is the JCR property type name. If the <code>@TypeHint</code> 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 <code>@TypeHint</code> value ends with <code>[]</code>, 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 <code>@TypeHint=<type>[]</code>.</p>
+<p>If the <code>@TypeHint</code> value ends with <code>[]</code>, it indicates a multi-value property. A multi-value property is usually auto-detected if there are multiple values for the property (i.e. 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 <code>@TypeHint=<type>[]</code>.</p>
<p>Example: The following form sets the numeric <code>width</code>, the boolean <code>checked</code>, and the multi-valued <code>hobbys</code> (with 3 values to enter) properties:</p>
<div class="codehilite"><pre><span class="nt"><form</span> <span class="na">method=</span><span class="s">"POST"</span> <span class="na">action=</span><span class="s">"/content/page/first"</span> <span class="na">enctype=</span><span class="s">"multipart/form-data"</span><span class="nt">></span>
<span class="nt"><input</span> <span class="na">type=</span><span class="s">"text"</span> <span class="na">name=</span><span class="s">"width"</span> <span class="nt">/></span>
@@ -383,7 +383,7 @@ of a resource without having to specify
</pre></div>
-<p>In real applications you would need some javascript that allows to add/remove values, ie. add/remove inputs with the name "hobbys". Or a pure javascript based form post would be used, that gathers the properties to update programmatically, but the additional parameter <code>hobbys@TypeHint=String[]</code> would be the same.</p>
+<p>In real applications you would need some JavaScript that allows to add/remove values, ie. add/remove inputs with the name "hobbys". Or a pure JavaScript based form post would be used, that gathers the properties to update programmatically, but the additional parameter <code>hobbys@TypeHint=String[]</code> would be the same.</p>
<p>The <code>@TypeHint</code> suffixed parameter is assumed to be single-valued. If the parameter has multiple values, only the first is actually used.</p>
<p>For multi-value properties, see also the <code>@Patch</code> option.</p>
<p>For more information on applying <code>@TypeHint</code> to a file upload parameter see the section on File Uploads above.</p>
@@ -447,7 +447,7 @@ of a resource without having to specify
</pre></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 <code>@ValueFrom</code> parameter is prefixed and thus the <code>supplied_text</code> parameter is not used for property setting.</p>
+<p>To prevent storing the additional parameters in the repository you might want to use the prefixing mechanism as shown in the example above, where the <code>@ValueFrom</code> parameter is prefixed and thus the <code>supplied_text</code> parameter is not used for property setting.</p>
<p>The <code>@ValueFrom</code> suffixed parameter is assumed to be single-valued. If the parameter has multiple values it is ignored completely.</p>
<p>The <code>@ValueFrom</code> suffixed parameter is also special in that there must not be a correlated parameter without a suffix. Thus have parameters <code>text</code> and <code>text@ValueFrom</code> may have unexpected results.</p>
<h6 id="delete"><code>@Delete</code></h6>
@@ -465,7 +465,7 @@ of a resource without having to specify
<p>The <code>@Delete</code> suffixed parameter is also special in that there need not be a correlated parameter without a suffix. If both -- a parameters <code>text</code> and <code>text@Delete</code> are set, the <code>text</code> property is first deleted and then filled with the new content.</p>
-<p>The <code>@Delete</code> 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 -- this may be a property or a node, actually -- addressed by the <code>@Delete</code> suffixed parameter is just removed if it exists. If the item does not exist, nothing happens.</p>
+<p>The <code>@Delete</code> 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 creation and modification are done. Any item -- this may be a property or a node, actually -- addressed by the <code>@Delete</code> suffixed parameter is just removed if it exists. If the item does not exist, nothing happens.</p>
<h6 id="movefrom"><code>@MoveFrom</code></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 <code>@MoveFrom</code> suffixed parameter may be set to the repository path of the node to where you uploaded the image file.</p>
@@ -483,7 +483,7 @@ of a resource without having to specify
<p>If there exists no repository item at the indicated path, nothing is done. If the item indicated by the <code>@MoveFrom</code> suffixed parameter already exists, it is replaced by the item addressed by the parameter value -- unless of course there is no item at the named location.</p>
<p>The <code>@MoveFrom</code> suffixed parameter is assumed to be single-valued. If the parameter has multiple values it is ignored completely.</p>
<p>The <code>@MoveFrom</code> suffixed parameter is also special in that there must not be a correlated parameter without a suffix. Thus have parameters <code>text</code> and <code>text@MoveFrom</code> may have unexpected results.</p>
-<p>The <code>@MoveFrom</code> suffixed parameter in fact calls for a sub-operation, which is executed after the <code>@Delete</code> sub operation but before any other tasks of content creattion and modification are done.</p>
+<p>The <code>@MoveFrom</code> suffixed parameter in fact calls for a sub-operation, which is executed after the <code>@Delete</code> sub operation but before any other tasks of content creation and modification are done.</p>
<h6 id="copyfrom"><code>@CopyFrom</code></h6>
<p>Similar to the <code>@MoveFrom</code> suffix exists a <code>@CopyFrom</code> 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 <code>/tmp/upload/123</code>. 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>
@@ -514,10 +514,10 @@ of a resource without having to specify
</pre></div>
-<p>The array will be treated like a set: when adding a value, it will only be added once if it does not exist yet; when removing a value, all occurences of it will be removed. For values not affected by the add or remove operations, nothing changes. An existing array with duplicate entries will not automatically be converted into a set.</p>
+<p>The array will be treated like a set: when adding a value, it will only be added once if it does not exist yet; when removing a value, all occurrences of it will be removed. For values not affected by the add or remove operations, nothing changes. An existing array with duplicate entries will not automatically be converted into a set.</p>
<p>The format for an individual parameter value is <code><operation><value></code>. If there is no or no valid operation given, this value will be ignored.</p>
<p>Operation <code>+</code> will add the <code><value></code> to the array if it is not part of it yet.</p>
-<p>Operation <code>-</code> will remove all occurences of <code><value></code> from the array.</p>
+<p>Operation <code>-</code> will remove all occurrences of <code><value></code> from the array.</p>
<p>The value of the <code>@Patch</code> suffixed parameter is irrelevant, it can be empty (example above uses <code>true</code> for clarity).</p>
<p>All types should be supported via <code>@TypeHint</code>, but it needs to indicate a multi-value property, ending with <code>[]</code>.</p>
<h5 id="algorithm-for-node-name-creation">Algorithm for Node Name Creation</h5>
@@ -525,7 +525,7 @@ of a resource without having to specify
<ol>
<li>If a <code>:name</code> 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 <code>:name</code> 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 <code>:nameHint</code> 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 <code>[ title, jcr:title, name, description, jcr:description, abstract ](</code> refs.-title-jcr-title-name-description-jcr-description-abstract.path <code>)</code>. The first request parameter with a non-empty value is used and filtered to get the valid JCR name.</li>
+<li>Otherwise a series of request parameters 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 to <code>[ title, jcr:title, name, description, jcr:description, abstract ](</code> refs.-title-jcr-title-name-description-jcr-description-abstract.path <code>)</code>. 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>
@@ -579,7 +579,7 @@ of a resource without having to specify
<tbody>
<tr>
<td>200/OK</td>
-<td>The resource (and all its descendents) has been removed</td>
+<td>The resource (and all its descendants) has been removed</td>
</tr>
<tr>
<td>404/NOT FOUND</td>
@@ -1021,7 +1021,7 @@ of a resource without having to specify
<p>does the trick. To be redirected after the reodering, the <code>:redirect</code> parameter may optionally also be specified.</p>
<h3 id="redirect"><code>:redirect</code></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 <code>Location</code> header is set to the value of the <code>:redirect</code> parameter.</p>
+<p>Instructs the SlingPostServlet to redirect the client to the indicated location if the operation succeeds. That is the response status is set to <em>302/FOUND</em> and the <code>Location</code> header is set to the value of the <code>:redirect</code> parameter.</p>
<h3 id="status"><code>:status</code></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 <code>:status</code> request parameter should be set to <code>browser</code>. If this parameter is not set, is empty, is set to <code>standard</code> or to any other value, the actual status code is sent back to the client.</p>
@@ -1029,9 +1029,11 @@ of a resource without having to specify
<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">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 "application/json", the JSON format is used, otherwise HTML is returned.
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:
-1. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,<strong>/</strong>;q=0.8
-1. Accept: application/json,<strong>/</strong>;q=0.9</p>
+<p>Examples:</p>
+<ol>
+<li>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,<strong>/</strong>;q=0.8</li>
+<li>Accept: application/json,<strong>/</strong>;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">RFC 2616, section 14.1</a> for information on the HTTP Accept header.</p>
<h2 id="versionable-node-support">Versionable Node Support</h2>
@@ -1059,7 +1061,7 @@ The Accept header can be overridden (and
<h3 id="slingpostprocessor">SlingPostProcessor</h3>
<p>TODO: document the SlingPostProcessor extension point, and related tests</p>
<div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
- Rev. 1651057 by bdelacretaz on Mon, 12 Jan 2015 10:46:21 +0000
+ Rev. 1666841 by rombert on Sun, 15 Mar 2015 20:47:56 +0000
</div>
<div class="trademarkFooter">
Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project