You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by gk...@apache.org on 2008/03/12 18:32:39 UTC

svn commit: r636431 - in /cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0: 1412_1_1.html changes-report.html images/1427_1_1.img images/1428_1_1.img images/1429_1_1.img

Author: gkossakowski
Date: Wed Mar 12 10:32:29 2008
New Revision: 636431

URL: http://svn.apache.org/viewvc?rev=636431&view=rev
Log:
Publish docs of Servlet Service Framework.

Added:
    cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/images/1427_1_1.img   (with props)
    cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/images/1428_1_1.img   (with props)
    cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/images/1429_1_1.img   (with props)
Modified:
    cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/1412_1_1.html
    cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/changes-report.html

Modified: cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/1412_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/1412_1_1.html?rev=636431&r1=636430&r2=636431&view=diff
==============================================================================
--- cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/1412_1_1.html (original)
+++ cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/1412_1_1.html Wed Mar 12 10:32:29 2008
@@ -133,7 +133,144 @@
       </ul>
          <div id="contentBody"><div id="bodyText"><h1 class="docTitle">Overview</h1><p>This is the implementation of the Servlet-Service framework. It doesn't have
 any dependencies on Cocoon core and can be used to introduce standardized
-communication between any servlets.</p></div><div class="editUrl"><div><em>Errors and Improvements?</em> If you see any errors or potential improvements in this document please help
+communication between any servlets.</p><div class="note"><div><strong>Note: </strong>You can easily check dependencies of Servlet Service Framework
+yourself
+<a href="http://cocoon.apache.org/subprojects/servlet-service/1.0/servlet-service-impl/1.0/dependencies.html">here</a>.
+</div></div><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Introduction to architecture</h1><p>Servlet Services Framework (SSF) is built around few concepts:</p><ul>
+<li>request dispatching</li>
+<li>standarized communication between servlets</li>
+<li>Object Oriented techniques:</li>
+<ul>
+<li>abstraction/composition</li>
+<li>inheritance</li>
+<li>polymporhism</li>
+<li>encapsulation</li>
+</ul>
+
+</ul>that we will discuss in-detail later.<h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Request dispatching</h2>The most basic functionality is request dispatching handled by
+<a href="http://cocoon.apache.org/subprojects/servlet-service/1.0/servlet-service-impl/1.0/apidocs/org/apache/cocoon/servletservice/DispatcherServlet.html"><tt>DispatcherServlet</tt></a>
+which is sort of a very lightweight servlet container. Each servlet is
+registered to the DispatcherServlet with property <tt>mount-path</tt>. This
+property defines request path which can be used to access particular servlet.
+When request is being handled by the DispatcherServlet it scans list of
+registered servlets, checking if mount-path property of any servlet matches
+request's path. If such servlet is found DispatcherServlet dispatches request
+with<strong> fragment matching mount-path omitted</strong>.Following diagram illustrates the process.<img width="600" height="604" name="servlet service basic dispatching" alt="servlet service basic dispatching" src="images/1427_1_1.img"></img>The fact that mount-path is being omitted frees servlet implementator from
+bothering about it at development stage and makes it easy to configure
+mount-path property at deployment stage.<h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Connecting servlets</h2>Servlet Service Framework establishes standarized way for communication
+between servlets that exploits standards like Servlet API and HTTP. In order to
+communicate with other servlet you just need to make a
+<strong>connection</strong> to it and then just create a request that will look
+the same as it would come from browser. The requested servlet doesn't have to
+bother if request comes from another servlet or browser because it's totally
+transparent to it.<img width="600" height="462" name="servlet service connecting" alt="servlet service connecting" src="images/1428_1_1.img"></img><p>You should notice two things while look at the diagram:</p><ul>
+<li>DispatcherServlet is <strong>not</strong> involved in communication between
+connected servlets (it is performed using
+<a href="http://cocoon.apache.org/subprojects/servlet-service/1.0/servlet-service-impl/1.0/apidocs/org/apache/cocoon/servletservice/ServletConnection.html">ServletConnection</a>
+object). It also means that <tt>mount-path</tt> property has no application
+here.</li>
+<li>Request's path is passed untouched.</li>
+</ul><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Inheritance and polymorphism</h2>Servlet can act as component thus it can extend other one and override it's
+resource (request) handling. Nothing wrong is here, it's really about overriding
+resource handling not methods of class implementing servlet interface. If it was
+normal inheritance and polymorhism of classes then there would be no room for
+innovation, Java has it all since 1.0 version.<br></br>
+Servlet Service Framework cares only about <strong>resources</strong>
+(identified by URLs) particular servlet can handle and not about implementation
+of servlet class. Basically, it means that all widely known concepts of Object
+Oriented Programming are applied to resources. In order to help you understand
+how various notions map from OOP to Resource Oriented Architecture (ROA) take a
+look at following table:<table class="bodyTable">
+<tbody>
+<tr class="a">
+<th>
+Object Oriented Programming
+</th>
+<th>
+<p>Resource Oriented Architecture</p>
+</th>
+<th>
+<p>Remarks</p>
+</th>
+</tr>
+<tr class="b">
+<td>
+<p>calling <tt>getFooBar()</tt> method</p>
+</td>
+<td>
+<p>requesting <tt>/fooBar</tt> resource</p>
+</td>
+<td>
+<p>for making request HTTP GET method is used</p>
+</td>
+</tr>
+<tr class="a">
+<td>
+<p>calling <tt>getFooBar(value1, value2)</tt> method</p>
+</td>
+<td>
+<p>requesting <tt>/fooBar?param1=value1&amp;param2=value2</tt> resource</p>
+</td>
+<td>
+<p>if one of parameters contains binary data, then POST (or PUT but we won't get
+into details too much here) request is being made</p>
+</td>
+</tr>
+<tr class="b">
+<td><tt>classB</tt>
+<p>extends <tt>classA</tt></p>
+</td>
+<td><tt>servletB</tt>
+<p>connects to <tt>servletA</tt> using connection named <tt>super</tt></p>
+</td>
+<td>
+<p>Connection named &quot;super&quot; is reserved for inheritance implementation</p>
+</td>
+</tr>
+<tr class="a">
+<td><tt>classA</tt>
+<p>implements <tt>interfaceB</tt></p>
+</td>
+<td>
+<p>N/A</p>
+</td>
+<td>
+<p>Servlet Service Framework does no have any equivalent for strong typing known
+from programming languages so it cannot check if equivalent of interface is
+being implemented.<br></br>
+The interface concept known from OOP maps best to just an abstract contract.
+It's a servletA's contract to handle various resources but check if it really
+does can be made at runtime only. It's similar situation to scripting languages
+like Javascript.</p>
+</td>
+</tr>
+<tr class="b">
+<td><tt>classB</tt>
+<p>overrides method <tt>getFooBar()</tt> implemented in <tt>classA</tt></p>
+</td>
+<td><tt>servletB</tt>
+<p>implements handling of <tt>/fooBar</tt> resource.</p>
+</td>
+<td></td>
+</tr>
+</tbody>
+</table><p>Being aware of mapping between OOP and ROA let's see how SSF implementing
+these ideas looks in action.</p><p><img width="700" height="1347" name="servlet service inheritance" alt="servlet service inheritance" src="images/1429_1_1.img"></img></p><p>Now few remarks are needed:</p><ul>
+<li>Diagram above shows the situation when original request comes from browser
+(or other external program) and is handled by DispatcherServlet first. If
+request is being made by servlet using connection it would look similar to this
+one. It turns out that connection object is not a trivial object linking two
+servlets because it's connection's job to make all this magic of dispatching
+request to the super servlet if original one does not handle requested resource.
+</li>
+<li>Servlet B returns 404 status code as response and this simply means that
+Servlet B does not override handling of /foo/bar resource from servlet A. If
+servlet B had returned 200 status code, then DispatcherServlet would not make a
+second request to servlet A and would finish with response got from Servlet B.
+</li>
+<li>Mulitple levels of inheritance are possible (servlet A could connect to
+another servlet with connection named &quot;super&quot;).</li>
+</ul></div><div class="editUrl"><div><em>Errors and Improvements?</em> If you see any errors or potential improvements in this document please help
         us: <a href="http://cocoon.zones.apache.org/daisy/cdocs/1412?branch=1&language=1">View, Edit or comment</a> on the latest development version (registration required).
       </div></div></div>
     </div>

Modified: cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/changes-report.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/changes-report.html?rev=636431&r1=636430&r2=636431&view=diff
==============================================================================
--- cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/changes-report.html (original)
+++ cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/changes-report.html Wed Mar 12 10:32:29 2008
@@ -140,11 +140,11 @@
               </ul>
     </li>
       </ul>
-         <h2><a name="Changes Report"></a>Changes Report</h2><h3><a name="Release History"></a>Release History</h3><table class="bodyTable"><tr class="a"><th>Version</th><th>Date</th><th>Description</th></tr><tr class="b"><td><a href="#1.0.0">1.0.0</a></td><td>2008-00-00</td><td>unreleased</td></tr><tr class="a"><td><a href="#1.0.0-RC1">1.0.0-RC1</a></td><td>2007-10-29</td><td>released</td></tr></table><br /><br /><h3><a name="1.0.0"></a>Release 1.0.0 - 2008-00-00</h3><table class="bodyTable"><tr class="b"><th>Type</th><th>Changes</th><th>By</th></tr><tr class="a"><td><img src="images/add.gif" alt="add" /></td><td>nullThe "+" character is not allowed at the end of connection names anymore. Starting
+         <h2><a name="Changes Report"></a>Changes Report</h2><h3><a name="Release History"></a>Release History</h3><table class="bodyTable"><tr class="a"><th>Version</th><th>Date</th><th>Description</th></tr><tr class="b"><td><a href="#1.0.0">1.0.0</a></td><td>2008-00-00</td><td>unreleased</td></tr><tr class="a"><td><a href="#1.0.0-RC1">1.0.0-RC1</a></td><td>2007-10-29</td><td>released</td></tr><tr class="b"><td><a href="#1.0.0-RC2-SNAPSHOT">1.0.0-RC2-SNAPSHOT</a></td><td>2008-??-??</td><td>unreleased</td></tr></table><br /><br /><h3><a name="1.0.0"></a>Release 1.0.0 - 2008-00-00</h3><table class="bodyTable"><tr class="a"><th>Type</th><th>Changes</th><th>By</th></tr><tr class="b"><td><img src="images/add.gif" alt="add" /></td><td>nullThe "+" character is not allowed at the end of connection names anymore. Starting
 Cocoon will fail hard with a RuntimeException if this rule is broken. See
-org.apache.cocoon.servletservice.spring.ServletDecorator.</td><td><a href="team-list.html#reinhard">reinhard</a></td></tr><tr class="b"><td><img src="images/add.gif" alt="add" /></td><td>Add support for absolute ServetConnections.</td><td><a href="team-list.html#reinhard">reinhard</a></td></tr></table><h3><a name="1.0.0-RC1"></a>Release 1.0.0-RC1 - 2007-10-29</h3><table class="bodyTable"><tr class="a"><th>Type</th><th>Changes</th><th>By</th></tr><tr class="b"><td><img src="images/add.gif" alt="add" /></td><td>Implemented true Object Oriented approach for handling servlet calls.
-This change removes the need for explicit super calls. Fixes <a href="https://issues.apache.org/jira/browse/ViewIssue.jspa?key=COCOON-2038">COCOON-2038<img src="images/external.png" /></a>.</td><td><a href="team-list.html#gkossakowski">gkossakowski</a></td></tr><tr class="a"><td><img src="images/fix.gif" alt="fix" /></td><td>Fixed handling of multilevel inheritance that could cause stack overflow. Fixes <a href="https://issues.apache.org/jira/browse/ViewIssue.jspa?key=COCOON-1939">COCOON-1939<img src="images/external.png" /></a>.</td><td><a href="team-list.html#gkossakowski">gkossakowski</a></td></tr><tr class="b"><td><img src="images/fix.gif" alt="fix" /></td><td>Fixed bug in DispatcherServlet that caused servlet (blocks) mounte
-d at "/" to be handled improperly. Fixes <a href="https://issues.apache.org/jira/browse/ViewIssue.jspa?key=COCOON-2121">COCOON-2121<img src="images/external.png" /></a>.</td><td><a href="team-list.html#gkossakowski">gkossakowski</a></td></tr></table>
+org.apache.cocoon.servletservice.spring.ServletDecorator.</td><td><a href="team-list.html#reinhard">reinhard</a></td></tr><tr class="a"><td><img src="images/add.gif" alt="add" /></td><td>Add support for absolute ServetConnections.</td><td><a href="team-list.html#reinhard">reinhard</a></td></tr></table><h3><a name="1.0.0-RC1"></a>Release 1.0.0-RC1 - 2007-10-29</h3><table class="bodyTable"><tr class="b"><th>Type</th><th>Changes</th><th>By</th></tr><tr class="a"><td><img src="images/add.gif" alt="add" /></td><td>Implemented true Object Oriented approach for handling servlet calls.
+This change removes the need for explicit super calls. Fixes <a href="https://issues.apache.org/jira/browse/ViewIssue.jspa?key=COCOON-2038">COCOON-2038<img src="images/external.png" /></a>.</td><td><a href="team-list.html#gkossakowski">gkossakowski</a></td></tr><tr class="b"><td><img src="images/fix.gif" alt="fix" /></td><td>Fixed handling of multilevel inheritance that could cause stack overflow. Fixes <a href="https://issues.apache.org/jira/browse/ViewIssue.jspa?key=COCOON-1939">COCOON-1939<img src="images/external.png" /></a>.</td><td><a href="team-list.html#gkossakowski">gkossakowski</a></td></tr><tr class="a"><td><img src="images/fix.gif" alt="fix" /></td><td>Fixed bug in DispatcherServlet that caused servlet (blocks) mo
+unted at "/" to be handled improperly. Fixes <a href="https://issues.apache.org/jira/browse/ViewIssue.jspa?key=COCOON-2121">COCOON-2121<img src="images/external.png" /></a>.</td><td><a href="team-list.html#gkossakowski">gkossakowski</a></td></tr></table><h3><a name="1.0.0-RC2-SNAPSHOT"></a>Release 1.0.0-RC2-SNAPSHOT - 2008-??-??</h3><table class="bodyTable"><tr class="b"><th>Type</th><th>Changes</th><th>By</th></tr><tr class="a"><td><img src="images/add.gif" alt="add" /></td><td>Throw an exception when circular dependencies in servlet connections are detected. Fixes <a href="https://issues.apache.org/jira/browse/ViewIssue.jspa?key=COCOON-2036">COCOON-2036<img src="images/external.png" /></a>. Thanks to <a href="mailto:alexander.klimetschek@googlemail.com">Alexander Klimetschek</a>.</td><td><a href="team-list.html#gkossakowski">gkossakowski</a></td></tr></table>
     </div>
 
     <!-- end of content -->

Added: cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/images/1427_1_1.img
URL: http://svn.apache.org/viewvc/cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/images/1427_1_1.img?rev=636431&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/images/1427_1_1.img
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/images/1428_1_1.img
URL: http://svn.apache.org/viewvc/cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/images/1428_1_1.img?rev=636431&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/images/1428_1_1.img
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/images/1429_1_1.img
URL: http://svn.apache.org/viewvc/cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/images/1429_1_1.img?rev=636431&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cocoon/site/site/subprojects/servlet-service/1.0/servlet-service-impl/1.0/images/1429_1_1.img
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream