You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by ad...@apache.org on 2014/03/05 18:35:49 UTC

svn commit: r1574584 [3/3] - in /wicket/common/site/trunk/_site/guide: ./ gapi/ gapi/DefaultPackage/ gapi/spring/ guide/ guide/pages/ guide/src/docs/guide/ guide/src/docs/guide/wicketstuff/

Modified: wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_2.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_2.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_2.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_2.html Wed Mar  5 17:35:45 2014
@@ -213,7 +213,7 @@ textArea.add(<span class="java&#45;keywo
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
     
 </div>

Modified: wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_3.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_3.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_3.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_3.html Wed Mar  5 17:35:45 2014
@@ -204,7 +204,7 @@ function addJsClass() {
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
     
 </div>

Modified: wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_4.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_4.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_4.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_4.html Wed Mar  5 17:35:45 2014
@@ -198,7 +198,7 @@ add(<span class="java&#45;keyword">new</
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
     
 </div>

Modified: wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_5.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_5.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_5.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_5.html Wed Mar  5 17:35:45 2014
@@ -197,7 +197,7 @@ add(grid);</pre></div><p class="paragrap
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
     
 </div>

Added: wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_6.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_6.html?rev=1574584&view=auto
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_6.html (added)
+++ wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_6.html Wed Mar  5 17:35:45 2014
@@ -0,0 +1,224 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+    <title>26.6 Module wicketstuff-rest-annotations 6.x</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen, print" title="Style" charset="utf-8"/>
+    <link rel="stylesheet" href="../css/pdf.css" type="text/css" media="print" title="PDF" charset="utf-8"/>
+    <script type="text/javascript">
+function addJsClass() {
+    var classes = document.body.className.split(" ");
+    classes.push("js");
+    document.body.className = classes.join(" ");
+}
+    </script>
+</head>
+
+<body class="body" onload="addJsClass();">
+<div id="navigation">
+    <ul>
+        <li>
+            <div id="nav-summary" onmouseover="toggleNavSummary(false)" onmouseout="toggleNavSummary(true)">
+                <a href="../../guide/index.html" class="button">Table of contents</a>
+
+                <div id="nav-summary-childs" style="display:none;">
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/introduction.html"><strong>1</strong><span>Introduction</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/howToSource.html"><strong>2</strong><span>How to use the example code</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/whyLearn.html"><strong>3</strong><span>Why should I learn Wicket?</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/helloWorld.html"><strong>4</strong><span>Wicket says &ldquo;Hello world!&rdquo;</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/layout.html"><strong>5</strong><span>Wicket as page layout manager</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/keepControl.html"><strong>6</strong><span>Keeping control over HTML</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/componentLifecycle.html"><strong>7</strong><span>Components lifecycle</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/versioningCaching.html"><strong>8</strong><span>Page versioning and caching</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/requestProcessing.html"><strong>9</strong><span>Under the hood of the request processing</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/urls.html"><strong>10</strong><span>Wicket Links and URL generation</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/modelsforms.html"><strong>11</strong><span>Wicket models and forms</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/forms2.html"><strong>12</strong><span>Wicket forms in detail</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/repeaters.html"><strong>13</strong><span>Displaying multiple items with repeaters</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/i18n.html"><strong>14</strong><span>Internationalization with Wicket</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/resources.html"><strong>15</strong><span>Resource management with Wicket</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/jsintegration.html"><strong>16</strong><span>An example of integration with JavaScript</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/advanced.html"><strong>17</strong><span>Wicket advanced topics</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/ajax.html"><strong>18</strong><span>Working with AJAX</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/jee.html"><strong>19</strong><span>Integration with enterprise containers</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/nativewebsockets.html"><strong>20</strong><span>Native WebSockets</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/security.html"><strong>21</strong><span>Security with Wicket</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/testing.html"><strong>22</strong><span>Test Driven Development with Wicket</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/testingspring.html"><strong>23</strong><span>Test Driven Development with Wicket and Spring</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/bestpractices.html"><strong>24</strong><span>Wicket Best Practices</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/maven.html"><strong>25</strong><span>Working with Maven (Appendix)</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/wicketstuff.html"><strong>26</strong><span>Project WicketStuff (Appendix)</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/redirects.html"><strong>27</strong><span>Lost In Redirection With Apache Wicket (Appendix)</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../../guide/contributing.html"><strong>28</strong><span>Contributing to this guide (Appendix)</span></a>
+                    </div>
+                    
+                </div>
+            </div>
+        </li>
+        <li class="separator selected">
+            <a id="ref-button" onclick="localToggle(); return false;" href="#">Quick Reference</a>
+        </li>
+    </ul>
+</div>
+<div id="header">
+    <div class="images clearfix">
+        
+        <span id="logo"><a href="/" target="_blank"><img height="80px" src="http://wicket.apache.org/guide/img/apache-wicket.png"/></a></span>
+        
+        
+        <span id="sponsor"><a href="http://www.apache.org/" target="_blank"><img height="60px" src="http://wicket.apache.org/guide/img/asf_logo.gif"/></a></span>
+        
+    </div>
+    <p>Free Online Guide for Apache Wicket framework</p>
+</div>
+
+
+<table id="colset" border="0" cellpadding="0" cellspacing="0">
+    <tr>
+        <td id="col1">
+            <div id="main" class="corner-all">
+
+                
+                    <div class="toc-item prev-left"><a href="../../guide/maven.html">&lt;&lt; <strong>25</strong><span>Working with Maven (Appendix)</span></a></div>
+                
+
+                <span id='toggle-col1' class="toggle">(<a href="#" onclick="localToggle(); return false;">Quick Reference</a>)</span>
+
+                
+                    <div class="toc-item next-right"><a href="../../guide/redirects.html"><strong>27</strong><span>Lost In Redirection With Apache Wicket (Appendix)</span> >></a></div>
+                
+
+
+                <div class="project">
+                    <h1>26.6 Module wicketstuff-rest-annotations - Reference Documentation</h1>
+
+                    <p><strong>Authors:</strong> Andrea Del Bene, Carsten Hufe, Christian Kroemer, Daniel Bartl, Paul Borș</p>
+
+                    <p><strong>Version:</strong> 6.x</p>
+
+                    
+                </div>
+
+                
+
+                
+
+<h2 id="wicketstuff_6">26.6 Module wicketstuff-rest-annotations</h2>
+REST-based API are becoming more and more popular around the web and the number of services based on this architecture is constantly increasing.<p class="paragraph"/>Wicket is well-known for its capability of transparently handling the state of web applications on server side, but it can be also easily adopted to create RESTful services.
+WicketStuff module for REST provides a special resource class and a set of annotations to implement REST APIs/services in much the same way as we do it with Spring MVC or with the standard JAX-RS.<p class="paragraph"/>The module provides class <code>AbstractRestResource</code> as generic abstract class to implement a Wicket resource that handles the request and the response using a particular data format (XML, JSON, etc...).
+Subclassing <code>AbstractRestResource</code> we can create custom resources and map their pubblic methods to a given subpath with annotation <code>MethodMapping</code>. The following snippet is taken from resource <code>PersonsRestResource</code> inside module <code>'restannotations-examples'</code>:<p class="paragraph"/><div class="code"><pre>@MethodMapping(<span class="java&#45;quote">"/persons"</span>)
+    <span class="java&#45;keyword">public</span> List&#60;PersonPojo&#62; getAllPersons() &#123;
+        //method mapped at subpath <span class="java&#45;quote">"/persons"</span> and HTTP method GET
+    &#125;<p class="paragraph"/>    @MethodMapping(value = <span class="java&#45;quote">"/persons/&#123;personIndex&#125;"</span>, httpMethod = HttpMethod.DELETE)
+    <span class="java&#45;keyword">public</span> void deletePerson(<span class="java&#45;object">int</span> personIndex) &#123;
+        //method mapped at subpath <span class="java&#45;quote">"/persons/&#123;personIndex&#125;"</span> and HTTP method DELETE. 
+        //Segment &#123;personIndex&#125; will contain an integer value as index.
+    &#125;<p class="paragraph"/>    @MethodMapping(value = <span class="java&#45;quote">"/persons"</span>, httpMethod = HttpMethod.POST)
+    <span class="java&#45;keyword">public</span> void createPerson(@RequestBody PersonPojo personPojo) &#123;
+        //creates a <span class="java&#45;keyword">new</span> instance of PersonPojo reading it from request body
+    &#125;</pre></div><p class="paragraph"/><code>MethodMapping</code> requires to specify the subpath we want to map the method to. In addition we can specify also the HTTP method that must be used to invoke the method via REST (GET, POST, DELETE, PATCH, etc...). This value can be specified with enum class <code>HttpMethod</code> and is GET by default. 
+In the code above we can see annotation <code>RequestBody</code> which is used to extract the value of a method parameter from the request body (method createPerson).
+To write/read objects to response/from request, <code>AbstractRestResource</code> uses an implementation of interface <code>IWebSerialDeserial</code> which defines the following methods:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">public</span> <span class="java&#45;keyword">interface</span> IWebSerialDeserial &#123;<p class="paragraph"/>       <span class="java&#45;keyword">public</span> void objectToResponse(<span class="java&#45;object">Object</span> targetObject, WebResponse response, <span class="java&#45;object">String</span> mimeType) <span class="java&#45;keyword">throws</span> Exception;<p class="paragraph"/>       <span class="java&#45;keyword">public</span> &#60;T&#62; T requestToObject(WebRequest request, <span class="java&#45;object">Class</span>&#60;T&#62; argClass, <span class="java&#45;object">String</span> mimeType) <span class="java&#45;keyword">throws</span> Exception;<p class="paragraph"/>       <span class="java&#45;keyword">public
 </span> <span class="java&#45;object">boolean</span> isMimeTypeSupported(<span class="java&#45;object">String</span> mimeType);
+    &#125;</pre></div><p class="paragraph"/>To convert segments value (which are strings) to parameters type, <code>AbstractRestResource</code> uses the standard Wicket mechanism based on the application converter locator:<p class="paragraph"/><div class="code"><pre>//<span class="java&#45;keyword">return</span> the converter <span class="java&#45;keyword">for</span> type clazz
+    IConverter converter = Application.get().getConverterLocator().getConverter(clazz);
+    //convert string to object
+    <span class="java&#45;keyword">return</span> converter.convertToObject(value, Session.get().getLocale());</pre></div><p class="paragraph"/>In order to promote the principle of convention over configuration, we don't need to use any annotation to map method parameters to path parameters if they are declared in the same order. If we need to manually bind method parameters to path parameters we can use annotation <code>PathParam</code>.<p class="paragraph"/><div class="code"><pre>@MethodMapping(value = <span class="java&#45;quote">"/variable/&#123;p1&#125;/order/&#123;p2&#125;"</span>, produces = RestMimeTypes.PLAIN_TEXT)
+    <span class="java&#45;keyword">public</span> <span class="java&#45;object">String</span> testParamOutOfOrder(<code>PathParam(<span class="java&#45;quote">"p2"</span>) <span class="java&#45;object">String</span> textParam, </code>PathParam(<span class="java&#45;quote">"p1"</span>) <span class="java&#45;object">int</span> intParam) &#123;
+        //method parameter textParam is taken from path param 'p2', <span class="java&#45;keyword">while</span> intParam uses 'p1'
+    &#125;</pre></div><p class="paragraph"/>As JSON is de-facto standard format for REST API, the project comes also with a ready-to-use resource (<code>GsonRestResource</code>) and a serial/deserial (<code>GsonSerialDeserial</code>) that work with JSON format (both inside module <code>'restannotations-json'</code>). These classes use Gson as JSON library.<p class="paragraph"/><code>AbstractRestResource</code> supports role-based authorizations for mapped method with annotation <code>AuthorizeInvocation</code>:<p class="paragraph"/><div class="code"><pre>@MethodMapping(value = <span class="java&#45;quote">"/admin"</span>, httpMethod = HttpMethod.GET)
+    @AuthorizeInvocation(<span class="java&#45;quote">"ROLE_ADMIN"</span>)
+    <span class="java&#45;keyword">public</span> void testMethodAdminAuth() &#123;<p class="paragraph"/>    &#125;</pre></div><p class="paragraph"/>To use annotation <code>AuthorizeInvocation</code> we must specify in the resource construcor an instance of Wicket interface <code>IRoleCheckingStrategy</code>.<p class="paragraph"/>To read the complete documentation of the module and to discover more advanced feature please refer to the <a href="https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/wicketstuff-restannotations-parent" target="blank">project homepage</a>
+
+
+
+                <div style="clear:both;margin-top:15px;"></div>
+                
+                    <div class="toc-item prev-left"><a href="../../guide/maven.html">&lt;&lt; <strong>25</strong><span>Working with Maven (Appendix)</span></a></div>
+                
+                    <div class="toc-item next-right"><a href="../../guide/redirects.html"><strong>27</strong><span>Lost In Redirection With Apache Wicket (Appendix)</span> >></a></div>
+                
+                <div style="clear:both"></div>
+            </div>
+        </td>
+        <td id="col2">
+            <div class="local clearfix">
+                <div class="local-title">
+                    <a href="../../guide/index.html" target="mainFrame">Quick Reference</a>
+                    <span class="toggle">(<a href="#" onclick="localToggle(); return false;">hide</a>)</span>
+                </div>
+                <div class="menu">
+                    
+                </div>
+            </div>
+        </td>
+    </tr>
+</table>
+
+<div id="footer">
+    
+Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
+
+    
+</div>
+
+<script type="text/javascript" src="../js/docs.js"></script>
+
+</body>
+</html>

Modified: wicket/common/site/trunk/_site/guide/guide/redirects.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/redirects.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/redirects.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/redirects.html Wed Mar  5 17:35:45 2014
@@ -224,7 +224,7 @@ Quite a few teams have already got stuck
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
     
 </div>

Modified: wicket/common/site/trunk/_site/guide/guide/repeaters.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/repeaters.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/repeaters.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/repeaters.html Wed Mar  5 17:35:45 2014
@@ -348,7 +348,7 @@ Wicket provides also component PageableL
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
     
 </div>

Modified: wicket/common/site/trunk/_site/guide/guide/requestProcessing.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/requestProcessing.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/requestProcessing.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/requestProcessing.html Wed Mar  5 17:35:45 2014
@@ -309,7 +309,7 @@ Remember that invalidateNow() will immed
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
     
 </div>

Modified: wicket/common/site/trunk/_site/guide/guide/resources.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/resources.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/resources.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/resources.html Wed Mar  5 17:35:45 2014
@@ -440,7 +440,7 @@ In this chapter we have learnt how to ma
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
     
 </div>

Modified: wicket/common/site/trunk/_site/guide/guide/security.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/security.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/security.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/security.html Wed Mar  5 17:35:45 2014
@@ -457,7 +457,7 @@ Application class <code>AuthenticatedWeb
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
     
 </div>

Modified: wicket/common/site/trunk/_site/guide/guide/single.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/single.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/single.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/single.html Wed Mar  5 17:35:45 2014
@@ -476,6 +476,8 @@ function addJsClass(el) {
                             
                             <div class="toc-item" style="margin-left:10px"><a href="#wicketstuff_5"><strong>26.5</strong><span>Module wicketstuff-inmethod-grid</span></a></div>
                             
+                            <div class="toc-item" style="margin-left:10px"><a href="#wicketstuff_6"><strong>26.6</strong><span>Module wicketstuff-rest-annotations</span></a></div>
+                            
                             <div class="toc-item" style="margin-left:0px"><a href="#redirects"><strong>27</strong><span>Lost In Redirection With Apache Wicket (Appendix)</span></a></div>
                             
                             <div class="toc-item" style="margin-left:0px"><a href="#contributing"><strong>28</strong><span>Contributing to this guide (Appendix)</span></a></div>
@@ -4566,6 +4568,34 @@ List&#60;IGridColumn&#62; cols = (List) 
 add(grid);</pre></div><p class="paragraph"/>In the code above we have used convenience class DefaultDataGrid that is a subclass of DataGrid and it already comes with a navigation toolbar.<p class="paragraph"/>The example pages are under package com.inmethod.grid.examples.pages in the example project which is hosted at <a href="http://www.wicket-library.com/inmethod-grid/data-grid/simple" target="blank">http://www.wicket-library.com/inmethod-grid/data-grid/simple</a> .<p class="paragraph"/>
 
 
+<h2 id="wicketstuff_6">26.6 Module wicketstuff-rest-annotations</h2>
+REST-based API are becoming more and more popular around the web and the number of services based on this architecture is constantly increasing.<p class="paragraph"/>Wicket is well-known for its capability of transparently handling the state of web applications on server side, but it can be also easily adopted to create RESTful services.
+WicketStuff module for REST provides a special resource class and a set of annotations to implement REST APIs/services in much the same way as we do it with Spring MVC or with the standard JAX-RS.<p class="paragraph"/>The module provides class <code>AbstractRestResource</code> as generic abstract class to implement a Wicket resource that handles the request and the response using a particular data format (XML, JSON, etc...).
+Subclassing <code>AbstractRestResource</code> we can create custom resources and map their pubblic methods to a given subpath with annotation <code>MethodMapping</code>. The following snippet is taken from resource <code>PersonsRestResource</code> inside module <code>'restannotations-examples'</code>:<p class="paragraph"/><div class="code"><pre>@MethodMapping(<span class="java&#45;quote">"/persons"</span>)
+    <span class="java&#45;keyword">public</span> List&#60;PersonPojo&#62; getAllPersons() &#123;
+        //method mapped at subpath <span class="java&#45;quote">"/persons"</span> and HTTP method GET
+    &#125;<p class="paragraph"/>    @MethodMapping(value = <span class="java&#45;quote">"/persons/&#123;personIndex&#125;"</span>, httpMethod = HttpMethod.DELETE)
+    <span class="java&#45;keyword">public</span> void deletePerson(<span class="java&#45;object">int</span> personIndex) &#123;
+        //method mapped at subpath <span class="java&#45;quote">"/persons/&#123;personIndex&#125;"</span> and HTTP method DELETE. 
+        //Segment &#123;personIndex&#125; will contain an integer value as index.
+    &#125;<p class="paragraph"/>    @MethodMapping(value = <span class="java&#45;quote">"/persons"</span>, httpMethod = HttpMethod.POST)
+    <span class="java&#45;keyword">public</span> void createPerson(@RequestBody PersonPojo personPojo) &#123;
+        //creates a <span class="java&#45;keyword">new</span> instance of PersonPojo reading it from request body
+    &#125;</pre></div><p class="paragraph"/><code>MethodMapping</code> requires to specify the subpath we want to map the method to. In addition we can specify also the HTTP method that must be used to invoke the method via REST (GET, POST, DELETE, PATCH, etc...). This value can be specified with enum class <code>HttpMethod</code> and is GET by default. 
+In the code above we can see annotation <code>RequestBody</code> which is used to extract the value of a method parameter from the request body (method createPerson).
+To write/read objects to response/from request, <code>AbstractRestResource</code> uses an implementation of interface <code>IWebSerialDeserial</code> which defines the following methods:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">public</span> <span class="java&#45;keyword">interface</span> IWebSerialDeserial &#123;<p class="paragraph"/>       <span class="java&#45;keyword">public</span> void objectToResponse(<span class="java&#45;object">Object</span> targetObject, WebResponse response, <span class="java&#45;object">String</span> mimeType) <span class="java&#45;keyword">throws</span> Exception;<p class="paragraph"/>       <span class="java&#45;keyword">public</span> &#60;T&#62; T requestToObject(WebRequest request, <span class="java&#45;object">Class</span>&#60;T&#62; argClass, <span class="java&#45;object">String</span> mimeType) <span class="java&#45;keyword">throws</span> Exception;<p class="paragraph"/>       <span class="java&#45;keyword">public
 </span> <span class="java&#45;object">boolean</span> isMimeTypeSupported(<span class="java&#45;object">String</span> mimeType);
+    &#125;</pre></div><p class="paragraph"/>To convert segments value (which are strings) to parameters type, <code>AbstractRestResource</code> uses the standard Wicket mechanism based on the application converter locator:<p class="paragraph"/><div class="code"><pre>//<span class="java&#45;keyword">return</span> the converter <span class="java&#45;keyword">for</span> type clazz
+    IConverter converter = Application.get().getConverterLocator().getConverter(clazz);
+    //convert string to object
+    <span class="java&#45;keyword">return</span> converter.convertToObject(value, Session.get().getLocale());</pre></div><p class="paragraph"/>In order to promote the principle of convention over configuration, we don't need to use any annotation to map method parameters to path parameters if they are declared in the same order. If we need to manually bind method parameters to path parameters we can use annotation <code>PathParam</code>.<p class="paragraph"/><div class="code"><pre>@MethodMapping(value = <span class="java&#45;quote">"/variable/&#123;p1&#125;/order/&#123;p2&#125;"</span>, produces = RestMimeTypes.PLAIN_TEXT)
+    <span class="java&#45;keyword">public</span> <span class="java&#45;object">String</span> testParamOutOfOrder(<code>PathParam(<span class="java&#45;quote">"p2"</span>) <span class="java&#45;object">String</span> textParam, </code>PathParam(<span class="java&#45;quote">"p1"</span>) <span class="java&#45;object">int</span> intParam) &#123;
+        //method parameter textParam is taken from path param 'p2', <span class="java&#45;keyword">while</span> intParam uses 'p1'
+    &#125;</pre></div><p class="paragraph"/>As JSON is de-facto standard format for REST API, the project comes also with a ready-to-use resource (<code>GsonRestResource</code>) and a serial/deserial (<code>GsonSerialDeserial</code>) that work with JSON format (both inside module <code>'restannotations-json'</code>). These classes use Gson as JSON library.<p class="paragraph"/><code>AbstractRestResource</code> supports role-based authorizations for mapped method with annotation <code>AuthorizeInvocation</code>:<p class="paragraph"/><div class="code"><pre>@MethodMapping(value = <span class="java&#45;quote">"/admin"</span>, httpMethod = HttpMethod.GET)
+    @AuthorizeInvocation(<span class="java&#45;quote">"ROLE_ADMIN"</span>)
+    <span class="java&#45;keyword">public</span> void testMethodAdminAuth() &#123;<p class="paragraph"/>    &#125;</pre></div><p class="paragraph"/>To use annotation <code>AuthorizeInvocation</code> we must specify in the resource construcor an instance of Wicket interface <code>IRoleCheckingStrategy</code>.<p class="paragraph"/>To read the complete documentation of the module and to discover more advanced feature please refer to the <a href="https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/wicketstuff-restannotations-parent" target="blank">project homepage</a>
+
+
+
 <h1 id="redirects">27 Lost In Redirection With Apache Wicket (Appendix)</h1>
 Quite a few teams have already got stuck into the following problem when working with wicket forms in a clustered environment while having 2 (or more) tomcat server with enabled session replication running.<p class="paragraph"/>In case of invalid data being submitted with a form instance for example, it seemed like according error messages wouldn’t be presented when the same form page gets displayed again. Sometimes! And sometimes they would! One of those nightmares of rather deterministic programmer’s life. This so called Lost In Redirection problem, even if it looks like a wicket bug at first, is rather a result of a default setting in wicket regarding the processing of form submissions in general. In order to prevent another wide known problem of double form submissions, Wicket uses a so called REDIRECT_TO_BUFFER strategy for dealing with rendering a page after web form’s processing (@see IRequestCycleSettings#RenderStrategy).<p class="paragraph"/>What does the def
 ault RenderStrategy actually do?<p class="paragraph"/>Both logical parts of a single HTTP request, an action and a render part get processed within the same request, but instead of streaming the render result to the browser directly, the result is cached on the server first.<p class="paragraph"/><img border="0" class="center" src="../img/lost-in-redirection-mockup.png"></img><p class="paragraph"/>Wicket will create an according BufferedHttpServletResponse instance that will be used to cache the resulting HttpServletResponse within the WebApplication.<p class="paragraph"/><img border="0" class="center" src="../img/lost-in-redirection-mockup2.png"></img><p class="paragraph"/>After the buffered response is cached the HTTP status code of 302 get’s provided back to the browser resulting in an additional GET request to the redirect URL (which Wicket sets to the URL of the Form itself). There is a special handling code for this case in the WicketFilter instance that then looks up a Ma
 p of buffered responses within the WebApplication accordingly. If an appropriate already cached response for the current request is found, it get’s streamed back to the browser immediately. No additional form processing happens now. The following is a code snippet taken from WicketFilter:<p class="paragraph"/><div class="code"><pre>// Are we using REDIRECT_TO_BUFFER?
 <span class="java&#45;keyword">if</span> (webApplication.getRequestCycleSettings().getRenderStrategy() == IRequestCycleSettings.REDIRECT_TO_BUFFER)
@@ -4648,7 +4678,7 @@ and attach it to a ticket in Apache Wick
         <div id="footer">
             
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
             
         </div>

Modified: wicket/common/site/trunk/_site/guide/guide/single.pdf
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/single.pdf?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
Binary files - no diff available.

Modified: wicket/common/site/trunk/_site/guide/guide/src/docs/guide/toc.yml
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/src/docs/guide/toc.yml?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/src/docs/guide/toc.yml (original)
+++ wicket/common/site/trunk/_site/guide/guide/src/docs/guide/toc.yml Wed Mar  5 17:35:45 2014
@@ -203,6 +203,7 @@ wicketstuff:
   wicketstuff_3: Module wicketstuff-gmap3
   wicketstuff_4: Module wicketstuff-googlecharts
   wicketstuff_5: Module wicketstuff-inmethod-grid
+  wicketstuff_6: Module wicketstuff-rest-annotations
 redirects:
   title: Lost In Redirection With Apache Wicket (Appendix)
 contributing:

Added: wicket/common/site/trunk/_site/guide/guide/src/docs/guide/wicketstuff/wicketstuff_6.gdoc
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/src/docs/guide/wicketstuff/wicketstuff_6.gdoc?rev=1574584&view=auto
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/src/docs/guide/wicketstuff/wicketstuff_6.gdoc (added)
+++ wicket/common/site/trunk/_site/guide/guide/src/docs/guide/wicketstuff/wicketstuff_6.gdoc Wed Mar  5 17:35:45 2014
@@ -0,0 +1,76 @@
+REST-based API are becoming more and more popular around the web and the number of services based on this architecture is constantly increasing.
+
+Wicket is well-known for its capability of transparently handling the state of web applications on server side, but it can be also easily adopted to create RESTful services.
+WicketStuff module for REST provides a special resource class and a set of annotations to implement REST APIs/services in much the same way as we do it with Spring MVC or with the standard JAX-RS.
+
+The module provides class @AbstractRestResource@ as generic abstract class to implement a Wicket resource that handles the request and the response using a particular data format (XML, JSON, etc...).
+Subclassing @AbstractRestResource@ we can create custom resources and map their pubblic methods to a given subpath with annotation @MethodMapping@. The following snippet is taken from resource @PersonsRestResource@ inside module @'restannotations-examples'@:
+
+{code}
+    @MethodMapping("/persons")
+    public List<PersonPojo> getAllPersons() {
+        //method mapped at subpath "/persons" and HTTP method GET
+    }
+
+    @MethodMapping(value = "/persons/{personIndex}", httpMethod = HttpMethod.DELETE)
+    public void deletePerson(int personIndex) {
+        //method mapped at subpath "/persons/{personIndex}" and HTTP method DELETE. 
+        //Segment {personIndex} will contain an integer value as index.
+    }
+
+    @MethodMapping(value = "/persons", httpMethod = HttpMethod.POST)
+    public void createPerson(@RequestBody PersonPojo personPojo) {
+        //creates a new instance of PersonPojo reading it from request body
+    }
+{code}
+
+@MethodMapping@ requires to specify the subpath we want to map the method to. In addition we can specify also the HTTP method that must be used to invoke the method via REST (GET, POST, DELETE, PATCH, etc...). This value can be specified with enum class @HttpMethod@ and is GET by default. 
+In the code above we can see annotation @RequestBody@ which is used to extract the value of a method parameter from the request body (method createPerson).
+To write/read objects to response/from request, @AbstractRestResource@ uses an implementation of interface @IWebSerialDeserial@ which defines the following methods: 
+
+{code}
+
+    public interface IWebSerialDeserial {
+
+       public void objectToResponse(Object targetObject, WebResponse response, String mimeType) throws Exception;
+
+       public <T> T requestToObject(WebRequest request, Class<T> argClass, String mimeType) throws Exception;
+
+       public boolean isMimeTypeSupported(String mimeType);
+    }
+{code}
+
+To convert segments value (which are strings) to parameters type, @AbstractRestResource@ uses the standard Wicket mechanism based on the application converter locator:
+
+{code}
+
+    //return the converter for type clazz
+    IConverter converter = Application.get().getConverterLocator().getConverter(clazz);
+    //convert string to object
+    return converter.convertToObject(value, Session.get().getLocale());
+{code}
+
+In order to promote the principle of convention over configuration, we don't need to use any annotation to map method parameters to path parameters if they are declared in the same order. If we need to manually bind method parameters to path parameters we can use annotation @PathParam@.
+
+{code}
+    @MethodMapping(value = "/variable/{p1}/order/{p2}", produces = RestMimeTypes.PLAIN_TEXT)
+    public String testParamOutOfOrder(@PathParam("p2") String textParam, @PathParam("p1") int intParam) {
+        //method parameter textParam is taken from path param 'p2', while intParam uses 'p1'
+    }
+{code}
+
+As JSON is de-facto standard format for REST API, the project comes also with a ready-to-use resource (@GsonRestResource@) and a serial/deserial (@GsonSerialDeserial@) that work with JSON format (both inside module @'restannotations-json'@). These classes use Gson as JSON library.
+
+@AbstractRestResource@ supports role-based authorizations for mapped method with annotation @AuthorizeInvocation@:
+
+{code}
+    @MethodMapping(value = "/admin", httpMethod = HttpMethod.GET)
+    @AuthorizeInvocation("ROLE_ADMIN")
+    public void testMethodAdminAuth() {
+
+    }
+{code}
+
+To use annotation @AuthorizeInvocation@ we must specify in the resource construcor an instance of Wicket interface @IRoleCheckingStrategy@.
+
+To read the complete documentation of the module and to discover more advanced feature please refer to the "project homepage":https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/wicketstuff-restannotations-parent

Modified: wicket/common/site/trunk/_site/guide/guide/testing.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/testing.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/testing.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/testing.html Wed Mar  5 17:35:45 2014
@@ -427,7 +427,7 @@ formTester.submit(<span class="java&#45;
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
     
 </div>

Modified: wicket/common/site/trunk/_site/guide/guide/testingspring.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/testingspring.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/testingspring.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/testingspring.html Wed Mar  5 17:35:45 2014
@@ -321,7 +321,7 @@ Since the development of many web applic
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
     
 </div>

Modified: wicket/common/site/trunk/_site/guide/guide/urls.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/urls.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/urls.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/urls.html Wed Mar  5 17:35:45 2014
@@ -366,7 +366,7 @@ setResponsePage(MountedPageWithPlacehold
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
     
 </div>

Modified: wicket/common/site/trunk/_site/guide/guide/versioningCaching.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/versioningCaching.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/versioningCaching.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/versioningCaching.html Wed Mar  5 17:35:45 2014
@@ -291,7 +291,7 @@ Page '&#60;page class&#62;' is not state
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
     
 </div>

Modified: wicket/common/site/trunk/_site/guide/guide/whyLearn.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/whyLearn.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/whyLearn.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/whyLearn.html Wed Mar  5 17:35:45 2014
@@ -244,7 +244,7 @@ Wicket is not the only component oriente
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
     
 </div>

Modified: wicket/common/site/trunk/_site/guide/guide/wicketstuff.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/wicketstuff.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/wicketstuff.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/wicketstuff.html Wed Mar  5 17:35:45 2014
@@ -174,6 +174,9 @@ function addJsClass() {
                     <div class="toc-item" style="margin-left:0px"><a href="#wicketstuff_5"><strong>26.5</strong><span>Module wicketstuff-inmethod-grid</span></a>
                     </div>
                     
+                    <div class="toc-item" style="margin-left:0px"><a href="#wicketstuff_6"><strong>26.6</strong><span>Module wicketstuff-rest-annotations</span></a>
+                    </div>
+                    
                 </div>
                 
 
@@ -264,6 +267,34 @@ List&#60;IGridColumn&#62; cols = (List) 
 add(grid);</pre></div><p class="paragraph"/>In the code above we have used convenience class DefaultDataGrid that is a subclass of DataGrid and it already comes with a navigation toolbar.<p class="paragraph"/>The example pages are under package com.inmethod.grid.examples.pages in the example project which is hosted at <a href="http://www.wicket-library.com/inmethod-grid/data-grid/simple" target="blank">http://www.wicket-library.com/inmethod-grid/data-grid/simple</a> .<p class="paragraph"/>
 
 
+<h2 id="wicketstuff_6">26.6 Module wicketstuff-rest-annotations</h2>
+REST-based API are becoming more and more popular around the web and the number of services based on this architecture is constantly increasing.<p class="paragraph"/>Wicket is well-known for its capability of transparently handling the state of web applications on server side, but it can be also easily adopted to create RESTful services.
+WicketStuff module for REST provides a special resource class and a set of annotations to implement REST APIs/services in much the same way as we do it with Spring MVC or with the standard JAX-RS.<p class="paragraph"/>The module provides class <code>AbstractRestResource</code> as generic abstract class to implement a Wicket resource that handles the request and the response using a particular data format (XML, JSON, etc...).
+Subclassing <code>AbstractRestResource</code> we can create custom resources and map their pubblic methods to a given subpath with annotation <code>MethodMapping</code>. The following snippet is taken from resource <code>PersonsRestResource</code> inside module <code>'restannotations-examples'</code>:<p class="paragraph"/><div class="code"><pre>@MethodMapping(<span class="java&#45;quote">"/persons"</span>)
+    <span class="java&#45;keyword">public</span> List&#60;PersonPojo&#62; getAllPersons() &#123;
+        //method mapped at subpath <span class="java&#45;quote">"/persons"</span> and HTTP method GET
+    &#125;<p class="paragraph"/>    @MethodMapping(value = <span class="java&#45;quote">"/persons/&#123;personIndex&#125;"</span>, httpMethod = HttpMethod.DELETE)
+    <span class="java&#45;keyword">public</span> void deletePerson(<span class="java&#45;object">int</span> personIndex) &#123;
+        //method mapped at subpath <span class="java&#45;quote">"/persons/&#123;personIndex&#125;"</span> and HTTP method DELETE. 
+        //Segment &#123;personIndex&#125; will contain an integer value as index.
+    &#125;<p class="paragraph"/>    @MethodMapping(value = <span class="java&#45;quote">"/persons"</span>, httpMethod = HttpMethod.POST)
+    <span class="java&#45;keyword">public</span> void createPerson(@RequestBody PersonPojo personPojo) &#123;
+        //creates a <span class="java&#45;keyword">new</span> instance of PersonPojo reading it from request body
+    &#125;</pre></div><p class="paragraph"/><code>MethodMapping</code> requires to specify the subpath we want to map the method to. In addition we can specify also the HTTP method that must be used to invoke the method via REST (GET, POST, DELETE, PATCH, etc...). This value can be specified with enum class <code>HttpMethod</code> and is GET by default. 
+In the code above we can see annotation <code>RequestBody</code> which is used to extract the value of a method parameter from the request body (method createPerson).
+To write/read objects to response/from request, <code>AbstractRestResource</code> uses an implementation of interface <code>IWebSerialDeserial</code> which defines the following methods:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">public</span> <span class="java&#45;keyword">interface</span> IWebSerialDeserial &#123;<p class="paragraph"/>       <span class="java&#45;keyword">public</span> void objectToResponse(<span class="java&#45;object">Object</span> targetObject, WebResponse response, <span class="java&#45;object">String</span> mimeType) <span class="java&#45;keyword">throws</span> Exception;<p class="paragraph"/>       <span class="java&#45;keyword">public</span> &#60;T&#62; T requestToObject(WebRequest request, <span class="java&#45;object">Class</span>&#60;T&#62; argClass, <span class="java&#45;object">String</span> mimeType) <span class="java&#45;keyword">throws</span> Exception;<p class="paragraph"/>       <span class="java&#45;keyword">public
 </span> <span class="java&#45;object">boolean</span> isMimeTypeSupported(<span class="java&#45;object">String</span> mimeType);
+    &#125;</pre></div><p class="paragraph"/>To convert segments value (which are strings) to parameters type, <code>AbstractRestResource</code> uses the standard Wicket mechanism based on the application converter locator:<p class="paragraph"/><div class="code"><pre>//<span class="java&#45;keyword">return</span> the converter <span class="java&#45;keyword">for</span> type clazz
+    IConverter converter = Application.get().getConverterLocator().getConverter(clazz);
+    //convert string to object
+    <span class="java&#45;keyword">return</span> converter.convertToObject(value, Session.get().getLocale());</pre></div><p class="paragraph"/>In order to promote the principle of convention over configuration, we don't need to use any annotation to map method parameters to path parameters if they are declared in the same order. If we need to manually bind method parameters to path parameters we can use annotation <code>PathParam</code>.<p class="paragraph"/><div class="code"><pre>@MethodMapping(value = <span class="java&#45;quote">"/variable/&#123;p1&#125;/order/&#123;p2&#125;"</span>, produces = RestMimeTypes.PLAIN_TEXT)
+    <span class="java&#45;keyword">public</span> <span class="java&#45;object">String</span> testParamOutOfOrder(<code>PathParam(<span class="java&#45;quote">"p2"</span>) <span class="java&#45;object">String</span> textParam, </code>PathParam(<span class="java&#45;quote">"p1"</span>) <span class="java&#45;object">int</span> intParam) &#123;
+        //method parameter textParam is taken from path param 'p2', <span class="java&#45;keyword">while</span> intParam uses 'p1'
+    &#125;</pre></div><p class="paragraph"/>As JSON is de-facto standard format for REST API, the project comes also with a ready-to-use resource (<code>GsonRestResource</code>) and a serial/deserial (<code>GsonSerialDeserial</code>) that work with JSON format (both inside module <code>'restannotations-json'</code>). These classes use Gson as JSON library.<p class="paragraph"/><code>AbstractRestResource</code> supports role-based authorizations for mapped method with annotation <code>AuthorizeInvocation</code>:<p class="paragraph"/><div class="code"><pre>@MethodMapping(value = <span class="java&#45;quote">"/admin"</span>, httpMethod = HttpMethod.GET)
+    @AuthorizeInvocation(<span class="java&#45;quote">"ROLE_ADMIN"</span>)
+    <span class="java&#45;keyword">public</span> void testMethodAdminAuth() &#123;<p class="paragraph"/>    &#125;</pre></div><p class="paragraph"/>To use annotation <code>AuthorizeInvocation</code> we must specify in the resource construcor an instance of Wicket interface <code>IRoleCheckingStrategy</code>.<p class="paragraph"/>To read the complete documentation of the module and to discover more advanced feature please refer to the <a href="https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/wicketstuff-restannotations-parent" target="blank">project homepage</a>
+
+
+
                 <div style="clear:both;margin-top:15px;"></div>
                 
                     <div class="toc-item prev-left"><a href="../guide/maven.html">&lt;&lt; <strong>25</strong><span>Working with Maven (Appendix)</span></a></div>
@@ -290,7 +321,7 @@ add(grid);</pre></div><p class="paragrap
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
     
 </div>

Modified: wicket/common/site/trunk/_site/guide/index.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/index.html?rev=1574584&r1=1574583&r2=1574584&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/index.html (original)
+++ wicket/common/site/trunk/_site/guide/index.html Wed Mar  5 17:35:45 2014
@@ -476,6 +476,8 @@ function addJsClass(el) {
                             
                             <div class="toc-item" style="margin-left:10px"><a href="./guide/wicketstuff.html#wicketstuff_5"><strong>26.5</strong><span>Module wicketstuff-inmethod-grid</span></a></div>
                             
+                            <div class="toc-item" style="margin-left:10px"><a href="./guide/wicketstuff.html#wicketstuff_6"><strong>26.6</strong><span>Module wicketstuff-rest-annotations</span></a></div>
+                            
                             <div class="toc-item" style="margin-left:0px"><a href="./guide/redirects.html"><strong>27</strong><span>Lost In Redirection With Apache Wicket (Appendix)</span></a></div>
                             
                             <div class="toc-item" style="margin-left:0px"><a href="./guide/contributing.html"><strong>28</strong><span>Contributing to this guide (Appendix)</span></a></div>
@@ -503,7 +505,7 @@ function addJsClass(el) {
         <div id="footer">
             
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-02-22)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
 
             
         </div>