incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Sling Website > URL decomposition
Date Wed, 02 Sep 2009 13:36:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=SLINGxSITE&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/SLINGxSITE/URL+decomposition">URL
decomposition</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~mykee">Mike
Mueller</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <h1><a name="URLdecomposition-URLdecomposition"></a>URL decomposition</h1>

<p>During the <em>Resource Resolution</em> step, the client request URL
is decomposed into the following parts:</p>

<ol>
	<li><b>Resource Path</b> -  The longest substring of the request URL such
that the resource path is either the complete request URL or the next character in the request
URL after the resource path is a dot (<tt>.</tt>).</li>
	<li><b>Selectors</b> -  If the first character in the request URL after
the resource path is a dot, the string after the dot up to but not including the last dot
before the next slash character or the end of the request URL. If the resource path spans
the complete request URL no seletors exist. If only one dot follows the resource path before
the end of the request URL or the next slash, also no selectors exist.</li>
	<li><b>Extension</b> -  The string after the last dot after the resource
path in the request URL but before the end of the request URL or the next slash after the
resource path in the request URL.</li>
	<li><b>Suffix Path</b> -  If the request URL contains a slash character
after the resource path and optional selectors and extension, the path starting with the slash
up to the end of the request URL is the suffix path. Otherwise, the suffix path is empty.
Note, that after the resource path at least a dot must be in the URL to let Sling detect the
resource path.</li>
</ol>


<p>There's a cheat sheet on Day's dev page under <a href="http://dev.day.com/microsling/content/blogs/main/cheatsheet/docroot/front.png"
rel="nofollow">http://dev.day.com/microsling/content/blogs/main/cheatsheet/docroot/front.png</a>
available to get you familiar with the URL decomposition of Sling.</p>

<p><b>Examples</b>: Assume there is a Resource at <tt>/a/b</tt>,
which has no children.</p>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> URI </th>
<th class='confluenceTh'> Resource Path </th>
<th class='confluenceTh'> Selectors </th>
<th class='confluenceTh'> Extension </th>
<th class='confluenceTh'> Suffix </th>
<th class='confluenceTh'> Resource Found </th>
</tr>
<tr>
<td class='confluenceTd'> /a/b                      </td>
<td class='confluenceTd'> /a/b </td>
<td class='confluenceTd'> null  </td>
<td class='confluenceTd'> null </td>
<td class='confluenceTd'> null       </td>
<td class='confluenceTd'> yes </td>
</tr>
<tr>
<td class='confluenceTd'> /a/b.html                 </td>
<td class='confluenceTd'> /a/b </td>
<td class='confluenceTd'> null  </td>
<td class='confluenceTd'> html </td>
<td class='confluenceTd'> null       </td>
<td class='confluenceTd'> yes </td>
</tr>
<tr>
<td class='confluenceTd'> /a/b.s1.html              </td>
<td class='confluenceTd'> /a/b </td>
<td class='confluenceTd'> s1    </td>
<td class='confluenceTd'> html </td>
<td class='confluenceTd'> null       </td>
<td class='confluenceTd'> yes </td>
</tr>
<tr>
<td class='confluenceTd'> /a/b.s1.s2.html           </td>
<td class='confluenceTd'> /a/b </td>
<td class='confluenceTd'> s1.s2 </td>
<td class='confluenceTd'> html </td>
<td class='confluenceTd'> null       </td>
<td class='confluenceTd'> yes </td>
</tr>
<tr>
<td class='confluenceTd'> /a/b/c/d                  </td>
<td class='confluenceTd'> /a/b/c/d </td>
<td class='confluenceTd'> null  </td>
<td class='confluenceTd'> null </td>
<td class='confluenceTd'> null       </td>
<td class='confluenceTd'> no! </td>
</tr>
<tr>
<td class='confluenceTd'> /a/b./c/d                  </td>
<td class='confluenceTd'> /a/b </td>
<td class='confluenceTd'> null  </td>
<td class='confluenceTd'> null </td>
<td class='confluenceTd'> /c/d       </td>
<td class='confluenceTd'> yes </td>
</tr>
<tr>
<td class='confluenceTd'> /a/b.html/c/d             </td>
<td class='confluenceTd'> /a/b </td>
<td class='confluenceTd'> null  </td>
<td class='confluenceTd'> html </td>
<td class='confluenceTd'> /c/d       </td>
<td class='confluenceTd'> yes </td>
</tr>
<tr>
<td class='confluenceTd'> /a/b.s1.html/c/d          </td>
<td class='confluenceTd'> /a/b </td>
<td class='confluenceTd'> s1    </td>
<td class='confluenceTd'> html </td>
<td class='confluenceTd'> /c/d       </td>
<td class='confluenceTd'> yes </td>
</tr>
<tr>
<td class='confluenceTd'> /a/b.s1.s2.html/c/d       </td>
<td class='confluenceTd'> /a/b </td>
<td class='confluenceTd'> s1.s2 </td>
<td class='confluenceTd'> html </td>
<td class='confluenceTd'> /c/d       </td>
<td class='confluenceTd'> yes </td>
</tr>
<tr>
<td class='confluenceTd'> /a/b/c/d.s.txt            </td>
<td class='confluenceTd'> /a/b/c/d </td>
<td class='confluenceTd'> s  </td>
<td class='confluenceTd'> txt </td>
<td class='confluenceTd'> null </td>
<td class='confluenceTd'> no! </td>
</tr>
<tr>
<td class='confluenceTd'> /a/b.html/c/d.s.txt       </td>
<td class='confluenceTd'> /a/b </td>
<td class='confluenceTd'> null  </td>
<td class='confluenceTd'> html </td>
<td class='confluenceTd'> /c/d.s.txt </td>
<td class='confluenceTd'> yes </td>
</tr>
<tr>
<td class='confluenceTd'> /a/b.s1.html/c/d.s.txt    </td>
<td class='confluenceTd'> /a/b </td>
<td class='confluenceTd'> s1    </td>
<td class='confluenceTd'> html </td>
<td class='confluenceTd'> /c/d.s.txt </td>
<td class='confluenceTd'> yes </td>
</tr>
<tr>
<td class='confluenceTd'> /a/b.s1.s2.html/c/d.s.txt </td>
<td class='confluenceTd'> /a/b </td>
<td class='confluenceTd'> s1.s2 </td>
<td class='confluenceTd'> html </td>
<td class='confluenceTd'> /c/d.s.txt </td>
<td class='confluenceTd'> yes </td>
</tr>
</tbody></table>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>Automated
tests and examples</b><br /><p>The <a href="http://svn.apache.org/repos/asf/sling/trunk/bundles/engine/src/test/java/org/apache/sling/engine/impl/request/SlingRequestPathInfoTest.java"
rel="nofollow">SlingRequestPathInfoTest</a> demonstrates and tests this decomposition.
Feel free to suggest additional tests that help clarify how this works!</p></td></tr></table></div>

     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/SLINGxSITE/URL+decomposition">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=2852958&revisedVersion=2&originalVersion=1">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/SLINGxSITE/URL+decomposition?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message