You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2011/04/03 12:03:01 UTC

svn commit: r1088238 [3/4] - in /wicket/common/site/trunk: ./ _posts/ _site/ _site/2009/07/30/ _site/2009/08/21/ _site/2009/10/12/ _site/2009/10/24/ _site/2009/12/13/ _site/2009/12/21/ _site/2010/02/01/ _site/2010/03/05/ _site/2010/05/03/ _site/2010/05...

Modified: wicket/common/site/trunk/_site/learn/examples/guestbook.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/examples/guestbook.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/examples/guestbook.html (original)
+++ wicket/common/site/trunk/_site/learn/examples/guestbook.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>
@@ -153,7 +153,45 @@
 <h2 id='commentjava'>Comment.java</h2>
 
 <p>The Comment POJO model is very straightforward:</p>
+<div class='highlight'><pre><code class='java'><span class='kn'>package</span> <span class='n'>org</span><span class='o'>.</span><span class='na'>apache</span><span class='o'>.</span><span class='na'>wicket</span><span class='o'>.</span><span class='na'>examples</span><span class='o'>.</span><span class='na'>guestbook</span><span class='o'>;</span>
 
+<span class='kn'>import</span> <span class='nn'>java.util.Date</span><span class='o'>;</span>  
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.IClusterable</span><span class='o'>;</span>
+
+<span class='kd'>public</span> <span class='kd'>class</span> <span class='nc'>Comment</span> <span class='kd'>implements</span> <span class='n'>IClusterable</span> <span class='o'>{</span>
+    <span class='kd'>private</span> <span class='n'>String</span> <span class='n'>text</span><span class='o'>;</span>
+    <span class='kd'>private</span> <span class='n'>Date</span> <span class='n'>date</span> <span class='o'>=</span> <span class='k'>new</span> <span class='n'>Date</span><span class='o'>();</span>
+
+    <span class='kd'>public</span> <span class='nf'>Comment</span><span class='o'>()</span> <span class='o'>{</span>
+    <span class='o'>}</span>
+
+    <span class='kd'>public</span> <span class='nf'>Comment</span><span class='o'>(</span><span class='kd'>final</span> <span class='n'>Comment</span> <span class='n'>comment</span><span class='o'>)</span> <span class='o'>{</span>
+        <span class='k'>this</span><span class='o'>.</span><span class='na'>text</span> <span class='o'>=</span> <span class='n'>comment</span><span class='o'>.</span><span class='na'>text</span><span class='o'>;</span>
+        <span class='k'>this</span><span class='o'>.</span><span class='na'>date</span> <span class='o'>=</span> <span class='n'>comment</span><span class='o'>.</span><span class='na'>date</span><span class='o'>;</span>
+    <span class='o'>}</span>
+
+    <span class='kd'>public</span> <span class='n'>String</span> <span class='nf'>getText</span><span class='o'>()</span> <span class='o'>{</span>
+        <span class='k'>return</span> <span class='n'>text</span><span class='o'>;</span>
+    <span class='o'>}</span>
+
+    <span class='kd'>public</span> <span class='kt'>void</span> <span class='nf'>setText</span><span class='o'>(</span><span class='n'>String</span> <span class='n'>text</span><span class='o'>)</span> <span class='o'>{</span>
+        <span class='k'>this</span><span class='o'>.</span><span class='na'>text</span> <span class='o'>=</span> <span class='n'>text</span><span class='o'>;</span>
+    <span class='o'>}</span>
+
+    <span class='kd'>public</span> <span class='n'>Date</span> <span class='nf'>getDate</span><span class='o'>()</span> <span class='o'>{</span>
+        <span class='k'>return</span> <span class='n'>date</span><span class='o'>;</span>
+    <span class='o'>}</span>
+
+    <span class='kd'>public</span> <span class='kt'>void</span> <span class='nf'>setDate</span><span class='o'>(</span><span class='n'>Date</span> <span class='n'>date</span><span class='o'>)</span> <span class='o'>{</span>
+        <span class='k'>this</span><span class='o'>.</span><span class='na'>date</span> <span class='o'>=</span> <span class='n'>date</span><span class='o'>;</span>
+    <span class='o'>}</span>
+
+    <span class='kd'>public</span> <span class='n'>String</span> <span class='nf'>toString</span><span class='o'>()</span> <span class='o'>{</span>
+        <span class='k'>return</span> <span class='s'>&quot;[Comment date = &quot;</span> <span class='o'>+</span> <span class='n'>date</span> <span class='o'>+</span> <span class='s'>&quot;, text = &quot;</span> <span class='o'>+</span> <span class='n'>text</span> <span class='o'>+</span> <span class='s'>&quot;]&quot;</span><span class='o'>;</span>
+    <span class='o'>}</span>
+<span class='o'>}</span>
+</code></pre>
+</div>
 <h2 id='guestbookjava'>GuestBook.java</h2>
 
 <p>In the file <code>GuestBook.java</code> we have put the Java component code for the guestbook page. This is the homepage for the guestbook application. The page consists of a form for entering new items to the guestbook and a list of repeating markup for showing the guestbook entries.</p>
@@ -163,7 +201,98 @@
 <p>Then as the view renders, the <code>populateItem</code> method is called passing in a <code>ListItem</code> container for the current row in the list.</p>
 
 <p>The implementation below obtains the <code>Comment</code> POJO from the list item and adds label components for the date and text of the <code>Comment</code>. This is all accomplished in just a few lines of code.</p>
+<div class='highlight'><pre><code class='java'><span class='kn'>package</span> <span class='n'>org</span><span class='o'>.</span><span class='na'>apache</span><span class='o'>.</span><span class='na'>wicket</span><span class='o'>.</span><span class='na'>examples</span><span class='o'>.</span><span class='na'>guestbook</span><span class='o'>;</span>
 
+<span class='kn'>import</span> <span class='nn'>java.util.ArrayList</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>java.util.Date</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>java.util.List</span><span class='o'>;</span>
+
+<span class='kn'>import</span> <span class='nn'>org.apache.commons.lang.StringUtils</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.examples.WicketExamplePage</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.markup.html.basic.Label</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.markup.html.basic.MultiLineLabel</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.markup.html.form.Form</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.markup.html.form.TextArea</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.markup.html.form.TextField</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.markup.html.list.ListItem</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.markup.html.list.PropertyListView</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.model.CompoundPropertyModel</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.util.value.ValueMap</span><span class='o'>;</span>
+
+
+<span class='kd'>public</span> <span class='kd'>final</span> <span class='kd'>class</span> <span class='nc'>GuestBook</span> <span class='kd'>extends</span> <span class='n'>WicketExamplePage</span> <span class='o'>{</span>
+    <span class='cm'>/** A global list of all comments from all users across all sessions */</span>
+    <span class='kd'>private</span> <span class='kd'>static</span> <span class='kd'>final</span> <span class='n'>List</span><span class='o'>&lt;</span><span class='n'>Comment</span><span class='o'>&gt;</span> <span class='n'>commentList</span> <span class='o'>=</span> <span class='k'>new</span> <span class='n'>ArrayList</span><span class='o'>&lt;</span><span class='n'>Comment</span><span class='o'>&gt;();</span>
+
+    <span class='cm'>/**</span>
+<span class='cm'>     * Constructor that is invoked when page is invoked without a session.</span>
+<span class='cm'>     */</span>
+    <span class='kd'>public</span> <span class='nf'>GuestBook</span><span class='o'>()</span> <span class='o'>{</span>
+        <span class='c1'>// Add comment form</span>
+        <span class='n'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>CommentForm</span><span class='o'>(</span><span class='s'>&quot;commentForm&quot;</span><span class='o'>));</span>
+
+        <span class='c1'>// Add commentListView of existing comments</span>
+        <span class='n'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>PropertyListView</span><span class='o'>&lt;</span><span class='n'>Comment</span><span class='o'>&gt;(</span><span class='s'>&quot;comments&quot;</span><span class='o'>,</span> <span class='n'>commentList</span><span class='o'>)</span> <span class='o'>{</span>
+            <span class='nd'>@Override</span>
+            <span class='kd'>public</span> <span class='kt'>void</span> <span class='nf'>populateItem</span><span class='o'>(</span><span class='kd'>final</span> <span class='n'>ListItem</span><span class='o'>&lt;</span><span class='n'>Comment</span><span class='o'>&gt;</span> <span class='n'>listItem</span><span class='o'>)</span> <span class='o'>{</span>
+                <span class='n'>listItem</span><span class='o'>.</span><span class='na'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>Label</span><span class='o'>(</span><span class='s'>&quot;date&quot;</span><span class='o'>));</span>
+                <span class='n'>listItem</span><span class='o'>.</span><span class='na'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>MultiLineLabel</span><span class='o'>(</span><span class='s'>&quot;text&quot;</span><span class='o'>));</span>
+            <span class='o'>}</span>
+        <span class='o'>}).</span><span class='na'>setVersioned</span><span class='o'>(</span><span class='kc'>false</span><span class='o'>);</span>
+    <span class='o'>}</span>
+
+    <span class='cm'>/**</span>
+<span class='cm'>     * A form that allows a user to add a comment.</span>
+<span class='cm'>     */</span>
+    <span class='kd'>public</span> <span class='kd'>final</span> <span class='kd'>class</span> <span class='nc'>CommentForm</span> <span class='kd'>extends</span> <span class='n'>Form</span><span class='o'>&lt;</span><span class='n'>ValueMap</span><span class='o'>&gt;</span> <span class='o'>{</span>
+        <span class='kd'>public</span> <span class='nf'>CommentForm</span><span class='o'>(</span><span class='kd'>final</span> <span class='n'>String</span> <span class='n'>id</span><span class='o'>)</span> <span class='o'>{</span>
+            <span class='c1'>// Construct form with no validation listener</span>
+            <span class='kd'>super</span><span class='o'>(</span><span class='n'>id</span><span class='o'>,</span> <span class='k'>new</span> <span class='n'>CompoundPropertyModel</span><span class='o'>&lt;</span><span class='n'>ValueMap</span><span class='o'>&gt;(</span><span class='k'>new</span> <span class='n'>ValueMap</span><span class='o'>()));</span>
+
+            <span class='c1'>// this is just to make the unit test happy</span>
+            <span class='n'>setMarkupId</span><span class='o'>(</span><span class='s'>&quot;commentForm&quot;</span><span class='o'>);</span>
+
+            <span class='c1'>// Add text entry widget</span>
+            <span class='n'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>TextArea</span><span class='o'>&lt;</span><span class='n'>String</span><span class='o'>&gt;(</span><span class='s'>&quot;text&quot;</span><span class='o'>).</span><span class='na'>setType</span><span class='o'>(</span><span class='n'>String</span><span class='o'>.</span><span class='na'>class</span><span class='o'>));</span>
+
+            <span class='c1'>// Add simple automated spam prevention measure.</span>
+            <span class='n'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>TextField</span><span class='o'>&lt;</span><span class='n'>String</span><span class='o'>&gt;(</span><span class='s'>&quot;comment&quot;</span><span class='o'>).</span><span class='na'>setType</span><span class='o'>(</span><span class='n'>String</span><span class='o'>.</span><span class='na'>class</span><span class='o'>));</span>
+        <span class='o'>}</span>
+
+        <span class='cm'>/**</span>
+<span class='cm'>         * Show the resulting valid edit</span>
+<span class='cm'>         */</span>
+        <span class='nd'>@Override</span>
+        <span class='kd'>public</span> <span class='kd'>final</span> <span class='kt'>void</span> <span class='nf'>onSubmit</span><span class='o'>()</span> <span class='o'>{</span>
+            <span class='n'>ValueMap</span> <span class='n'>values</span> <span class='o'>=</span> <span class='n'>getModelObject</span><span class='o'>();</span>
+
+            <span class='c1'>// check if the honey pot is filled</span>
+            <span class='k'>if</span> <span class='o'>(</span><span class='n'>StringUtils</span><span class='o'>.</span><span class='na'>isNotBlank</span><span class='o'>((</span><span class='n'>String</span><span class='o'>)</span><span class='n'>values</span><span class='o'>.</span><span class='na'>get</span><span class='o'>(</span><span class='s'>&quot;comment&quot;</span><span class='o'>)))</span> <span class='o'>{</span>
+                <span class='n'>error</span><span class='o'>(</span><span class='s'>&quot;Caught a spammer!!!&quot;</span><span class='o'>);</span>
+                <span class='k'>return</span><span class='o'>;</span>
+            <span class='o'>}</span>
+            <span class='c1'>// Construct a copy of the edited comment</span>
+            <span class='n'>Comment</span> <span class='n'>comment</span> <span class='o'>=</span> <span class='k'>new</span> <span class='n'>Comment</span><span class='o'>();</span>
+
+            <span class='c1'>// Set date of comment to add</span>
+            <span class='n'>comment</span><span class='o'>.</span><span class='na'>setDate</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>Date</span><span class='o'>());</span>
+            <span class='n'>comment</span><span class='o'>.</span><span class='na'>setText</span><span class='o'>((</span><span class='n'>String</span><span class='o'>)</span><span class='n'>values</span><span class='o'>.</span><span class='na'>get</span><span class='o'>(</span><span class='s'>&quot;text&quot;</span><span class='o'>));</span>
+            <span class='n'>commentList</span><span class='o'>.</span><span class='na'>add</span><span class='o'>(</span><span class='mi'>0</span><span class='o'>,</span> <span class='n'>comment</span><span class='o'>);</span>
+
+            <span class='c1'>// Clear out the text component</span>
+            <span class='n'>values</span><span class='o'>.</span><span class='na'>put</span><span class='o'>(</span><span class='s'>&quot;text&quot;</span><span class='o'>,</span> <span class='s'>&quot;&quot;</span><span class='o'>);</span>
+        <span class='o'>}</span>
+    <span class='o'>}</span>
+
+    <span class='cm'>/**</span>
+<span class='cm'>     * Clears the comments.</span>
+<span class='cm'>     */</span>
+    <span class='kd'>public</span> <span class='kd'>static</span> <span class='kt'>void</span> <span class='nf'>clear</span><span class='o'>()</span> <span class='o'>{</span>
+        <span class='n'>commentList</span><span class='o'>.</span><span class='na'>clear</span><span class='o'>();</span>
+    <span class='o'>}</span>
+<span class='o'>}</span>
+</code></pre>
+</div>
 <p>When the <code>CommentForm</code> is submitted, the <code>onSubmit()</code> method is called. Notice that nothing gets the value of the <code>TextArea</code> that was added in the <code>CommentForm</code> constructor. This is because the comment is the model and the third parameter to the <code>TextArea</code> constructor specified the property of the model to update. So all <code>onSubmit()</code> has to do is create a new comment from the model that was updated and add it to the comment list. When the page redraws, the new list will be rendered.</p>
 
 <p>We use a <code>Vector</code> as our shared static model used by <code>commentListView</code> (<code>commentList</code>) to ensure that it is only updated by one thread at a time. Remember, this is a multi-user application with a shared model!</p>
@@ -175,14 +304,71 @@
 <p>In the HTML below, notice the way that the <code>TextArea</code> component is being nested inside the <code>CommentForm</code>. Wicket is able to keep everything straight because the Java <code>Component.add()</code> calls have to result in the same nesting structure as the HTML.</p>
 
 <p>Finally, notice the <code>&lt;wicket:remove&gt;</code> block. This is simply markup that is there for previewing purposes only. When the page renders, it is stripped out.</p>
-
+<div class='highlight'><pre><code class='html'><span class='nt'>&lt;html</span> <span class='na'>xmlns:wicket=</span><span class='s'>&quot;http://wicket.apache.org/&quot;</span><span class='nt'>&gt;</span>
+<span class='nt'>&lt;head&gt;</span>
+    <span class='nt'>&lt;title&gt;</span>Wicket Examples - guestbook<span class='nt'>&lt;/title&gt;</span>
+    <span class='nt'>&lt;link</span> <span class='na'>rel=</span><span class='s'>&quot;stylesheet&quot;</span> <span class='na'>type=</span><span class='s'>&quot;text/css&quot;</span> <span class='na'>href=</span><span class='s'>&quot;style.css&quot;</span><span class='nt'>/&gt;</span>
+<span class='nt'>&lt;/head&gt;</span>
+<span class='nt'>&lt;body&gt;</span>
+  <span class='nt'>&lt;span</span> <span class='na'>wicket:id=</span><span class='s'>&quot;mainNavigation&quot;</span><span class='nt'>/&gt;</span>
+
+  <span class='nt'>&lt;form</span> <span class='na'>wicket:id =</span><span class='err'> </span><span class='s'>&quot;commentForm&quot;</span> <span class='na'>id =</span><span class='err'> </span><span class='s'>&quot;commentForm&quot;</span><span class='nt'>&gt;</span>
+    Add your comment here:
+    <span class='nt'>&lt;p&gt;</span>
+    <span class='nt'>&lt;textarea</span> <span class='na'>wicket:id =</span><span class='err'> </span><span class='s'>&quot;text&quot;</span><span class='nt'>&gt;</span>This is a comment<span class='nt'>&lt;/textarea&gt;</span>
+    <span class='nt'>&lt;input</span> <span class='na'>type=</span><span class='s'>&quot;text&quot;</span> <span class='na'>wicket:id=</span><span class='s'>&quot;comment&quot;</span> <span class='na'>class=</span><span class='s'>&quot;nospam&quot;</span> <span class='na'>onfocus=</span><span class='s'>&quot;getElementById(&#39;formsubmit&#39;).focus();&quot;</span><span class='nt'>/&gt;</span>
+    <span class='nt'>&lt;p&gt;</span>
+    <span class='nt'>&lt;input</span> <span class='na'>type =</span><span class='err'> </span><span class='s'>&quot;submit&quot;</span> <span class='na'>value =</span><span class='err'> </span><span class='s'>&quot;Submit&quot;</span> <span class='na'>id=</span><span class='s'>&quot;formsubmit&quot;</span><span class='nt'>/&gt;</span>
+  <span class='nt'>&lt;/form&gt;</span>
+  <span class='nt'>&lt;p/&gt;</span>
+  <span class='nt'>&lt;span</span> <span class='na'>wicket:id =</span><span class='err'> </span><span class='s'>&quot;comments&quot;</span> <span class='na'>id=</span><span class='s'>&quot;comments&quot;</span><span class='nt'>&gt;</span>
+    <span class='nt'>&lt;p&gt;</span>
+        <span class='nt'>&lt;span</span> <span class='na'>wicket:id=</span><span class='s'>&quot;date&quot;</span><span class='nt'>&gt;</span>1/1/2004<span class='nt'>&lt;/span&gt;&lt;br&gt;</span>
+        <span class='nt'>&lt;span</span> <span class='na'>wicket:id=</span><span class='s'>&quot;text&quot;</span><span class='nt'>&gt;</span>Comment text goes here.<span class='nt'>&lt;/span&gt;</span>
+    <span class='nt'>&lt;/p&gt;</span>
+  <span class='nt'>&lt;/span&gt;</span>
+  <span class='nt'>&lt;wicket:remove&gt;</span>
+    <span class='nt'>&lt;p&gt;</span>
+        1/2/2004<span class='nt'>&lt;br/&gt;</span>
+        More comment text here.
+    <span class='nt'>&lt;/p&gt;</span>
+  <span class='nt'>&lt;/wicket:remove&gt;</span>
+<span class='nt'>&lt;/body&gt;</span>
+<span class='nt'>&lt;/html&gt;</span>
+</code></pre>
+</div>
 <h2 id='guestbookapplicationjava'>GuestBookApplication.java</h2>
 
 <p>For completeness, we&#8217;ve included the <code>GuestBookApplication</code> class, and as a final treat the modifications to the <code>web.xml</code> file.</p>
+<div class='highlight'><pre><code class='java'><span class='kn'>package</span> <span class='n'>org</span><span class='o'>.</span><span class='na'>apache</span><span class='o'>.</span><span class='na'>wicket</span><span class='o'>.</span><span class='na'>examples</span><span class='o'>.</span><span class='na'>guestbook</span><span class='o'>;</span>
+
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.Page</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.examples.WicketExampleApplication</span><span class='o'>;</span>
 
+<span class='kd'>public</span> <span class='kd'>class</span> <span class='nc'>GuestBookApplication</span> <span class='kd'>extends</span> <span class='n'>WicketExampleApplication</span> <span class='o'>{</span>
+    <span class='kd'>public</span> <span class='nf'>GuestBookApplication</span><span class='o'>()</span> <span class='o'>{</span>
+    <span class='o'>}</span>
+
+    <span class='nd'>@Override</span>
+    <span class='kd'>public</span> <span class='n'>Class</span><span class='o'>&lt;</span> <span class='o'>?</span> <span class='kd'>extends</span> <span class='n'>Page</span><span class='o'>&gt;</span> <span class='n'>getHomePage</span><span class='o'>()</span> <span class='o'>{</span>
+        <span class='k'>return</span> <span class='n'>GuestBook</span><span class='o'>.</span><span class='na'>class</span><span class='o'>;</span>
+    <span class='o'>}</span>
+<span class='o'>}</span>
+</code></pre>
+</div>
 <h2 id='webxml'>web.xml</h2>
 
 <p>Add the following two sections (servlet and servlet-mapping) to your web.xml file for running this application.</p>
+<div class='highlight'><pre><code class='xml'><span class='nt'>&lt;filter&gt;</span>
+    <span class='nt'>&lt;filter-name&gt;</span>GuestBookApplication<span class='nt'>&lt;/filter-name&gt;</span>
+    <span class='nt'>&lt;filter-class&gt;</span>org.apache.wicket.protocol.http.WicketFilter<span class='nt'>&lt;/filter-class&gt;</span>
+    <span class='nt'>&lt;init-param&gt;</span>
+      <span class='nt'>&lt;param-name&gt;</span>applicationClassName<span class='nt'>&lt;/param-name&gt;</span>
+      <span class='nt'>&lt;param-value&gt;</span>org.apache.wicket.examples.guestbook.GuestBookApplication<span class='nt'>&lt;/param-value&gt;</span>
+    <span class='nt'>&lt;/init-param&gt;</span>
+<span class='nt'>&lt;/filter&gt;</span>
+</code></pre>
+</div>
 		</div>
         <div id="clearer"></div>
 		<div id="footer"><span>

Modified: wicket/common/site/trunk/_site/learn/examples/helloworld.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/examples/helloworld.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/examples/helloworld.html (original)
+++ wicket/common/site/trunk/_site/learn/examples/helloworld.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>
@@ -153,11 +153,35 @@
 <h3 id='helloworldapplicationjava'>HelloWorldApplication.java</h3>
 
 <p>Each Wicket application is defined by an Application object. This object defines what the home page is, and allows for some configuration.</p>
+<div class='highlight'><pre><code class='java'><span class='kn'>import</span> <span class='nn'>org.apache.wicket.protocol.http.WebApplication</span><span class='o'>;</span>
 
+<span class='kd'>public</span> <span class='kd'>class</span> <span class='nc'>HelloWorldApplication</span> <span class='kd'>extends</span> <span class='n'>WebApplication</span> <span class='o'>{</span>
+    <span class='kd'>public</span> <span class='nf'>HelloWorldApplication</span><span class='o'>()</span> <span class='o'>{</span>
+    <span class='o'>}</span>
+
+    <span class='cm'>/**</span>
+<span class='cm'>     * @see org.apache.wicket.Application#getHomePage()</span>
+<span class='cm'>     */</span>
+    <span class='nd'>@Override</span>
+    <span class='kd'>public</span> <span class='n'>Class</span> <span class='nf'>getHomePage</span><span class='o'>()</span> <span class='o'>{</span>
+        <span class='k'>return</span> <span class='n'>HelloWorld</span><span class='o'>.</span><span class='na'>class</span><span class='o'>;</span>
+    <span class='o'>}</span>
+<span class='o'>}</span>
+</code></pre>
+</div>
 <p>Here you can see that we define <code>wicket.examples.helloworld.HelloWorld</code> to be our home page. When the base URL of our application is requested, the markup rendered by the HelloWorld page is returned.</p>
 
 <h3 id='helloworldjava'>HelloWorld.java</h3>
+<div class='highlight'><pre><code class='java'><span class='kn'>import</span> <span class='nn'>org.apache.wicket.markup.html.WebPage</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.markup.html.basic.Label</span><span class='o'>;</span>
 
+<span class='kd'>public</span> <span class='kd'>class</span> <span class='nc'>HelloWorld</span> <span class='kd'>extends</span> <span class='n'>WebPage</span> <span class='o'>{</span>
+    <span class='kd'>public</span> <span class='nf'>HelloWorld</span><span class='o'>()</span> <span class='o'>{</span>
+        <span class='n'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>Label</span><span class='o'>(</span><span class='s'>&quot;message&quot;</span><span class='o'>,</span> <span class='s'>&quot;Hello World!&quot;</span><span class='o'>));</span>
+    <span class='o'>}</span>
+<span class='o'>}</span>
+</code></pre>
+</div>
 <p>The Label is constructed using two parameters:</p>
 
 <ol>
@@ -175,7 +199,13 @@
 <h3 id='helloworldhtml'>HelloWorld.html</h3>
 
 <p>The HTML file that defines our Hello World functionality is as follows:</p>
-
+<div class='highlight'><pre><code class='html'><span class='nt'>&lt;html&gt;</span>
+<span class='nt'>&lt;body&gt;</span>
+    <span class='nt'>&lt;span</span> <span class='na'>wicket:id=</span><span class='s'>&quot;message&quot;</span> <span class='na'>id=</span><span class='s'>&quot;message&quot;</span><span class='nt'>&gt;</span>Message goes here<span class='nt'>&lt;/span&gt;</span>
+<span class='nt'>&lt;/body&gt;</span>
+<span class='nt'>&lt;/html&gt;</span>
+</code></pre>
+</div>
 <p>In this file, you see two elements that need some attention:</p>
 
 <ul>
@@ -193,7 +223,28 @@
 <h3 id='webxml'>web.xml</h3>
 
 <p>In order to deploy our HelloWorld program, we need to make our application known to the application server by means of the web.xml file.</p>
-
+<div class='highlight'><pre><code class='xml'><span class='cp'>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
+<span class='cp'>&lt;!DOCTYPE web-app</span>
+<span class='cp'>      PUBLIC &quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&quot;</span>
+<span class='cp'>      &quot;http://java.sun.com/dtd/web-app_2_3.dtd&quot;&gt;</span>
+
+<span class='nt'>&lt;web-app&gt;</span>
+    <span class='nt'>&lt;display-name&gt;</span>Wicket Examples<span class='nt'>&lt;/display-name&gt;</span>
+    <span class='nt'>&lt;filter&gt;</span>
+        <span class='nt'>&lt;filter-name&gt;</span>HelloWorldApplication<span class='nt'>&lt;/filter-name&gt;</span>
+        <span class='nt'>&lt;filter-class&gt;</span>org.apache.wicket.protocol.http.WicketFilter<span class='nt'>&lt;/filter-class&gt;</span>
+        <span class='nt'>&lt;init-param&gt;</span>
+          <span class='nt'>&lt;param-name&gt;</span>applicationClassName<span class='nt'>&lt;/param-name&gt;</span>
+          <span class='nt'>&lt;param-value&gt;</span>org.apache.wicket.examples.helloworld.HelloWorldApplication<span class='nt'>&lt;/param-value&gt;</span>
+        <span class='nt'>&lt;/init-param&gt;</span>
+    <span class='nt'>&lt;/filter&gt;</span>
+    <span class='nt'>&lt;filter-mapping&gt;</span>
+        <span class='nt'>&lt;filter-name&gt;</span>HelloWorldApplication<span class='nt'>&lt;/filter-name&gt;</span>
+        <span class='nt'>&lt;url-pattern&gt;</span>/*<span class='nt'>&lt;/url-pattern&gt;</span>
+    <span class='nt'>&lt;/filter-mapping&gt;</span>
+<span class='nt'>&lt;/web-app&gt;</span>
+</code></pre>
+</div>
 <p>In this definition you see the Wicket filter defined, which handles all requests. In order to let Wicket know which application is available, only the applicationClassName filter parameter is needed.</p>
 
 <p>Also, notice the url-mapping to /*. The Wicket filter will only process requests that are Wicket requests. If a request is not Wicket related, the filter will pass the request on to the chain. This ensures that (static) resources outside the realm of the Wicket application, such as style sheets, JavaScript files, images and so forth will be served by the container.</p>

Modified: wicket/common/site/trunk/_site/learn/examples/index.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/examples/index.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/examples/index.html (original)
+++ wicket/common/site/trunk/_site/learn/examples/index.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>

Modified: wicket/common/site/trunk/_site/learn/examples/markupinheritance.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/examples/markupinheritance.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/examples/markupinheritance.html (original)
+++ wicket/common/site/trunk/_site/learn/examples/markupinheritance.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>
@@ -165,19 +165,80 @@
 <p>In Java you can extend classes. This same concept has been fitted into the markup parsing of Java. Markup containers that have files associated (page and panels) can inherit the markup of their super containers.</p>
 
 <p>This is done using two special Wicket tags: <code>&lt;wicket:child&gt;</code> and <code>&lt;wicket:extend&gt;</code>. In the super markup you define where the child markup should be put, and in the sub markup you delineate where the child markup starts and ends.</p>
-
+<div class='highlight'><pre><code class='html'><span class='nt'>&lt;html&gt;</span>
+<span class='nt'>&lt;head&gt;&lt;/head&gt;</span>
+<span class='nt'>&lt;body&gt;</span>
+This is in the super markup.<span class='nt'>&lt;br&gt;</span>
+<span class='nt'>&lt;wicket:child</span> <span class='nt'>/&gt;</span>
+This is in the super markup.<span class='nt'>&lt;br&gt;</span>
+<span class='nt'>&lt;/body&gt;</span>
+<span class='nt'>&lt;/html&gt;</span>
+</code></pre>
+</div>
 <p>In this markup you see two sentences that surround the <code>wicket:child</code> tag. All markup in this file will remain when a sub class of this page is created, only the <code>wicket:child</code> tag will be replaced with the child markup. So if we look at the following markup:</p>
-
+<div class='highlight'><pre><code class='html'><span class='nt'>&lt;html&gt;</span>
+<span class='nt'>&lt;head&gt;&lt;/head&gt;</span>
+<span class='nt'>&lt;body&gt;</span>
+This is in de child markup.<span class='nt'>&lt;br&gt;</span>
+<span class='nt'>&lt;wicket:extend&gt;</span>
+This is in the child markup.<span class='nt'>&lt;br&gt;</span>
+<span class='nt'>&lt;/wicket:extend&gt;</span>
+This is in the child markup.<span class='nt'>&lt;br&gt;</span>
+<span class='nt'>&lt;/body&gt;</span>
+<span class='nt'>&lt;/html&gt;</span>
+</code></pre>
+</div>
 <p>we can see the markup that should be included in the parent. Only the markup between the <code>wicket:extend</code> tags is included in the final page. Take a look at the following markup which is the final markup when you would use this in a Wicket application.</p>
-
+<div class='highlight'><pre><code class='html'><span class='nt'>&lt;html&gt;</span>
+<span class='nt'>&lt;head&gt;&lt;/head&gt;</span>
+<span class='nt'>&lt;body&gt;</span>
+This is in the super markup.<span class='nt'>&lt;br&gt;</span>
+<span class='nt'>&lt;wicket:child&gt;&lt;wicket:extend&gt;</span>
+This is in the child markup.<span class='nt'>&lt;br&gt;</span>
+<span class='nt'>&lt;/wicket:extend&gt;&lt;/wicket:child&gt;</span>
+This is in the super markup.<span class='nt'>&lt;br&gt;</span>
+<span class='nt'>&lt;/body&gt;</span>
+<span class='nt'>&lt;/html&gt;</span>
+</code></pre>
+</div>
 <p>Here you can see that the <code>&lt;wicket:child /&gt;</code> tag has been expanded, and its contents filled with exactly the markup between the <code>&lt;wicket:extend&gt;</code> tags. If you want to get rid of the special Wicket tags, you can disable that on the markup settings (<a href='http://wicketframework.org/api/wicket/settings/IMarkupSettings'>IMarkupSettings</a>).</p>
 
 <h2 id='implementing_the_basepage'>Implementing the BasePage</h2>
 
 <p>Now that we have seen the basics for markup inheritance, we can now take a look at the example at hand. Let&#8217;s first create the base page.</p>
+<div class='highlight'><pre><code class='java'><span class='kn'>package</span> <span class='n'>wicket</span><span class='o'>.</span><span class='na'>quickstart</span><span class='o'>;</span>
 
+<span class='kn'>import</span> <span class='nn'>wicket.markup.html.WebPage</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>wicket.markup.html.basic.Label</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>wicket.markup.html.link.BookmarkablePageLink</span><span class='o'>;</span>
+
+<span class='kd'>public</span> <span class='kd'>abstract</span> <span class='kd'>class</span> <span class='nc'>BasePage</span> <span class='kd'>extends</span> <span class='n'>WebPage</span> <span class='o'>{</span>
+	<span class='kd'>public</span> <span class='nf'>BasePage</span><span class='o'>()</span> <span class='o'>{</span>
+		<span class='n'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>BookmarkablePageLink</span><span class='o'>(</span><span class='s'>&quot;page1&quot;</span><span class='o'>,</span> <span class='n'>Page1</span><span class='o'>.</span><span class='na'>class</span><span class='o'>));</span>
+		<span class='n'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>BookmarkablePageLink</span><span class='o'>(</span><span class='s'>&quot;page2&quot;</span><span class='o'>,</span> <span class='n'>Page2</span><span class='o'>.</span><span class='na'>class</span><span class='o'>));</span>
+		<span class='n'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>Label</span><span class='o'>(</span><span class='s'>&quot;footer&quot;</span><span class='o'>,</span> <span class='s'>&quot;This is in the footer&quot;</span><span class='o'>));</span>
+	<span class='o'>}</span>
+<span class='o'>}</span>
+</code></pre>
+</div>
 <p>The two links should go into the header, and the footer in the footer of the page. Note that the abstract keyword isn&#8217;t required, but considered a good practise. Now let&#8217;s take a look at the markup for the BasePage</p>
-
+<div class='highlight'><pre><code class='html'><span class='nt'>&lt;html&gt;</span>
+<span class='nt'>&lt;head&gt;&lt;/head&gt;</span>
+<span class='nt'>&lt;body&gt;</span>
+<span class='nt'>&lt;div</span> <span class='na'>id=</span><span class='s'>&quot;header&quot;</span><span class='nt'>&gt;</span>
+    <span class='nt'>&lt;a</span> <span class='na'>href=</span><span class='s'>&quot;#&quot;</span> <span class='na'>wicket:id=</span><span class='s'>&quot;page1&quot;</span><span class='nt'>&gt;</span>Page1<span class='nt'>&lt;/a&gt;</span>
+    <span class='nt'>&lt;a</span> <span class='na'>href=</span><span class='s'>&quot;#&quot;</span> <span class='na'>wicket:id=</span><span class='s'>&quot;page2&quot;</span><span class='nt'>&gt;</span>Page2<span class='nt'>&lt;/a&gt;</span>
+<span class='nt'>&lt;/div&gt;</span>
+<span class='nt'>&lt;div</span> <span class='na'>id=</span><span class='s'>&quot;body&quot;</span><span class='nt'>&gt;</span>
+<span class='nt'>&lt;wicket:child</span> <span class='nt'>/&gt;</span>
+<span class='nt'>&lt;/div&gt;</span>
+<span class='nt'>&lt;div</span> <span class='na'>id=</span><span class='s'>&quot;footer&quot;</span><span class='nt'>&gt;</span>
+	<span class='nt'>&lt;span</span> <span class='na'>wicket:id=</span><span class='s'>&quot;footer&quot;</span><span class='nt'>&gt;&lt;/span&gt;</span>
+<span class='nt'>&lt;/div&gt;</span>
+<span class='nt'>&lt;/body&gt;</span>
+<span class='nt'>&lt;/html&gt;</span>
+</code></pre>
+</div>
 <p>In this markup file you see the specific basic layout: we have 3 div elements:</p>
 
 <ol>
@@ -193,13 +254,53 @@
 <h2 id='implementing_the_sub_pages'>Implementing the sub pages</h2>
 
 <p>We need to build two pages: <code>Page1</code> and <code>Page2</code>. Each page needs its own markup file and Java class. Let&#8217;s first implement <code>Page1</code>.</p>
+<div class='highlight'><pre><code class='java'><span class='kn'>package</span> <span class='n'>wicket</span><span class='o'>.</span><span class='na'>quickstart</span><span class='o'>;</span>
 
-<p>In this example you see that we add a new label component to the page: <code>label1</code>. This component is only available for <code>Page1</code>, as such <code>Page2</code> can define its own component hierarchy. Let&#8217;s take a look at the markup for <code>Page1</code>:</p>
+<span class='kn'>import</span> <span class='nn'>wicket.markup.html.basic.Label</span><span class='o'>;</span>
 
+<span class='kd'>public</span> <span class='kd'>class</span> <span class='nc'>Page1</span> <span class='kd'>extends</span> <span class='n'>BasePage</span> <span class='o'>{</span>
+	<span class='kd'>public</span> <span class='nf'>Page1</span><span class='o'>()</span> <span class='o'>{</span>
+		<span class='n'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>Label</span><span class='o'>(</span><span class='s'>&quot;label1&quot;</span><span class='o'>,</span> <span class='s'>&quot;This is in the subclass Page1&quot;</span><span class='o'>));</span>
+	<span class='o'>}</span>
+<span class='o'>}</span>
+</code></pre>
+</div>
+<p>In this example you see that we add a new label component to the page: <code>label1</code>. This component is only available for <code>Page1</code>, as such <code>Page2</code> can define its own component hierarchy. Let&#8217;s take a look at the markup for <code>Page1</code>:</p>
+<div class='highlight'><pre><code class='java'><span class='o'>&lt;</span><span class='n'>html</span><span class='o'>&gt;</span>
+<span class='o'>&lt;</span><span class='n'>head</span><span class='o'>&gt;&lt;/</span><span class='n'>head</span><span class='o'>&gt;</span>
+<span class='o'>&lt;</span><span class='n'>body</span><span class='o'>&gt;</span>
+<span class='o'>&lt;</span><span class='nl'>wicket:</span><span class='n'>extend</span><span class='o'>&gt;</span>
+<span class='o'>&lt;</span><span class='n'>h1</span><span class='o'>&gt;</span><span class='n'>Page1</span><span class='o'>&lt;/</span><span class='n'>h1</span><span class='o'>&gt;</span>
+<span class='o'>&lt;</span><span class='n'>span</span> <span class='nl'>wicket:</span><span class='n'>id</span><span class='o'>=</span><span class='s'>&quot;label1&quot;</span><span class='o'>&gt;&lt;/</span><span class='n'>span</span><span class='o'>&gt;</span>
+<span class='o'>&lt;/</span><span class='nl'>wicket:</span><span class='n'>extend</span><span class='o'>&gt;</span>
+<span class='o'>&lt;/</span><span class='n'>body</span><span class='o'>&gt;</span>
+<span class='o'>&lt;/</span><span class='n'>html</span><span class='o'>&gt;</span>
+</code></pre>
+</div>
 <p>Here you see that we added the <code>Label</code> component in the markup between the <code>wicket:extend</code> tags. If we were to add the component outside those tags, Wicket will not be able to render the component in the final page.</p>
 
 <p>Now, let&#8217;s do the same for <code>Page2</code>.</p>
+<div class='highlight'><pre><code class='java'><span class='kn'>package</span> <span class='n'>wicket</span><span class='o'>.</span><span class='na'>quickstart</span><span class='o'>;</span>
+
+<span class='kn'>import</span> <span class='nn'>wicket.markup.html.basic.Label</span><span class='o'>;</span>
 
+<span class='kd'>public</span> <span class='kd'>class</span> <span class='nc'>Page2</span> <span class='kd'>extends</span> <span class='n'>BasePage</span> <span class='o'>{</span>
+	<span class='kd'>public</span> <span class='nf'>Page2</span><span class='o'>()</span> <span class='o'>{</span>
+		<span class='n'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>Label</span><span class='o'>(</span><span class='s'>&quot;label2&quot;</span><span class='o'>,</span> <span class='s'>&quot;This is in the subclass Page2&quot;</span><span class='o'>));</span>
+	<span class='o'>}</span>
+<span class='o'>}</span>
+</code></pre>
+</div><div class='highlight'><pre><code class='html'><span class='nt'>&lt;html&gt;</span>
+<span class='nt'>&lt;head&gt;&lt;/head&gt;</span>
+<span class='nt'>&lt;body&gt;</span>
+<span class='nt'>&lt;wicket:extend&gt;</span>
+<span class='nt'>&lt;h1&gt;</span>Page2<span class='nt'>&lt;/h1&gt;</span>
+<span class='nt'>&lt;span</span> <span class='na'>wicket:id=</span><span class='s'>&quot;label2&quot;</span><span class='nt'>&gt;&lt;/span&gt;</span>
+<span class='nt'>&lt;/wicket:extend&gt;</span>
+<span class='nt'>&lt;/body&gt;</span>
+<span class='nt'>&lt;/html&gt;</span>
+</code></pre>
+</div>
 <p>In <code>Page2</code> you see that we have a different component structure (<code>label2</code> instead of <code>label1</code>), and as such that the pages are quite different.</p>
 
 <p>If you paste this code into a Wicket quickstart application, you can see it immediately working (don&#8217;t forget to set the homepage to <code>Page1</code> or <code>Page2</code>).</p>

Modified: wicket/common/site/trunk/_site/learn/examples/navomatic.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/examples/navomatic.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/examples/navomatic.html (original)
+++ wicket/common/site/trunk/_site/learn/examples/navomatic.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>
@@ -171,37 +171,148 @@
 <p>For example, here is markup for a simple Border subclass, a usage of that border, and the markup which would be output on rendering:</p>
 
 <h3 id='border_markup'>Border markup</h3>
-
+<div class='highlight'><pre><code class='html'><span class='nt'>&lt;html&gt;</span>
+<span class='nt'>&lt;body&gt;</span>
+    <span class='nt'>&lt;wicket:border&gt;</span>
+        First <span class='nt'>&lt;wicket:body/&gt;</span> Last
+    <span class='nt'>&lt;/wicket:border&gt;</span>
+<span class='nt'>&lt;/body&gt;</span>
+<span class='nt'>&lt;/html&gt;</span>
+</code></pre>
+</div>
 <h3 id='border_usage'>Border usage</h3>
-
+<div class='highlight'><pre><code class='html'><span class='nt'>&lt;html&gt;</span>
+<span class='nt'>&lt;body&gt;</span>
+  <span class='nt'>&lt;span</span> <span class='na'>wicket:id =</span><span class='err'> </span><span class='s'>&quot;myBorder&quot;</span><span class='nt'>&gt;</span>
+      Middle
+  <span class='nt'>&lt;/span&gt;</span>
+<span class='nt'>&lt;/body&gt;</span>
+<span class='nt'>&lt;/html&gt;</span>
+</code></pre>
+</div>
 <h3 id='rendered_markup'>Rendered markup</h3>
-
+<div class='highlight'><pre><code class='html'><span class='nt'>&lt;html&gt;</span>
+<span class='nt'>&lt;body&gt;</span>
+      First Middle Last
+<span class='nt'>&lt;/body&gt;</span>
+<span class='nt'>&lt;/html&gt;</span>
+</code></pre>
+</div>
 <p>In other words, the markup around the <code>&lt;wicket:body/&gt;</code> tag in the border component is sort of &#8220;wrapped around&#8221; the body of the <code>&lt;span&gt;</code> tag where the border is used. This seems simple in this example, but keep in mind that nested components and even nested borders can appear anywhere in either markup file. This can be used to create quite complex effects with relatively little code.</p>
 
 <h3 id='navomaticapplicationjava'>NavomaticApplication.java</h3>
 
 <p>Just as in the Hello World! example, we need to define our application. In this case, we set Page1 to be our home page.</p>
+<div class='highlight'><pre><code class='java'><span class='kn'>package</span> <span class='n'>org</span><span class='o'>.</span><span class='na'>apache</span><span class='o'>.</span><span class='na'>wicket</span><span class='o'>.</span><span class='na'>examples</span><span class='o'>.</span><span class='na'>navomatic</span><span class='o'>;</span>
 
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.protocol.http.WebApplication</span><span class='o'>;</span>
+
+<span class='kd'>public</span> <span class='kd'>class</span> <span class='nc'>NavomaticApplication</span> <span class='kd'>extends</span> <span class='n'>WebApplication</span> <span class='o'>{</span>
+    <span class='kd'>public</span> <span class='nf'>NavomaticApplication</span><span class='o'>()</span> <span class='o'>{</span>
+    <span class='o'>}</span>
+   
+    <span class='kd'>public</span> <span class='n'>Class</span> <span class='nf'>getHomePage</span><span class='o'>()</span> <span class='o'>{</span>
+        <span class='k'>return</span> <span class='n'>Page1</span><span class='o'>.</span><span class='na'>class</span><span class='o'>;</span>
+    <span class='o'>}</span>
+<span class='o'>}</span>
+</code></pre>
+</div>
 <h3 id='page1java'>Page1.java</h3>
 
 <p>The Page1 Java and HTML files look like this:</p>
+<div class='highlight'><pre><code class='java'><span class='kn'>package</span> <span class='n'>wicket</span><span class='o'>.</span><span class='na'>examples</span><span class='o'>.</span><span class='na'>navomatic</span><span class='o'>;</span>
 
-<h3 id='page1html'>Page1.html</h3>
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.markup.html.WebPage</span><span class='o'>;</span>
 
+<span class='kd'>public</span> <span class='kd'>class</span> <span class='nc'>Page1</span> <span class='kd'>extends</span> <span class='n'>WebPage</span> <span class='o'>{</span>
+    <span class='kd'>public</span> <span class='nf'>Page1</span><span class='o'>()</span> <span class='o'>{</span>
+        <span class='n'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>NavomaticBorder</span><span class='o'>(</span><span class='s'>&quot;navomaticBorder&quot;</span><span class='o'>));</span>
+    <span class='o'>}</span>
+<span class='o'>}</span>
+</code></pre>
+</div>
+<h3 id='page1html'>Page1.html</h3>
+<div class='highlight'><pre><code class='html'><span class='nt'>&lt;html&gt;</span>
+<span class='nt'>&lt;body&gt;</span> 
+    <span class='nt'>&lt;span</span> <span class='na'>wicket:id =</span><span class='err'> </span><span class='s'>&quot;navomaticBorder&quot;</span><span class='nt'>&gt;</span>
+        You are viewing Page1
+    <span class='nt'>&lt;/span&gt;</span>
+<span class='nt'>&lt;/body&gt;</span>
+<span class='nt'>&lt;/html&gt;</span>
+</code></pre>
+</div>
 <p>Notice that the NavomaticBorder component is attached to the <code>&lt;span&gt;</code> tag because the name of the component in the Java code is &#8220;navomaticBorder&#8221; and the <code>&lt;span&gt;</code> tag&#8217;s wicket:id attribute is set to &#8220;navomaticBorder&#8221;. Because the two names match, Wicket associates the NavomaticBorder Java component with the <code>&lt;span&gt;</code> tag.</p>
 
 <h3 id='page2java'>Page2.java</h3>
 
 <p>The Page2 Java and HTML files look almost identical (and we&#8217;ll omit the sources for Page3 altogether because it follows the same pattern):</p>
-
+<div class='highlight'><pre><code class='java'><span class='kd'>public</span> <span class='kd'>class</span> <span class='nc'>Page2</span> <span class='kd'>extends</span> <span class='n'>WebPage</span> <span class='o'>{</span>
+    <span class='kd'>public</span> <span class='nf'>Page2</span><span class='o'>()</span> <span class='o'>{</span>
+        <span class='n'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>NavomaticBorder</span><span class='o'>(</span><span class='s'>&quot;navomaticBorder&quot;</span><span class='o'>));</span>
+    <span class='o'>}</span>
+<span class='o'>}</span>
+</code></pre>
+</div>
 <h3 id='page2html'>Page2.html</h3>
-
+<div class='highlight'><pre><code class='html'><span class='nt'>&lt;html&gt;</span>
+<span class='nt'>&lt;body&gt;</span>
+    <span class='nt'>&lt;span</span> <span class='na'>wicket:id =</span><span class='err'> </span><span class='s'>&quot;navomaticBorder&quot;</span><span class='nt'>&gt;</span>
+        You are viewing Page2
+    <span class='nt'>&lt;/span&gt;</span>
+<span class='nt'>&lt;/body&gt;</span>
+<span class='nt'>&lt;/html&gt;</span>
+</code></pre>
+</div>
 <h3 id='navomaticborderjava'>NavomaticBorder.java</h3>
 
 <p>So how does NavomaticBorder work? Glad you asked. The Java code below simply adds the two BoxBorder components you see. These components are nested borders which each draw a thin black line around their contents. The rest of the magic is in the NavomaticBorder markup.</p>
+<div class='highlight'><pre><code class='java'><span class='kn'>package</span> <span class='n'>wicket</span><span class='o'>.</span><span class='na'>examples</span><span class='o'>.</span><span class='na'>navomatic</span><span class='o'>;</span>
 
-<h3 id='navomaticborderhtml'>NavomaticBorder.html</h3>
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.markup.html.border.Border</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>org.apache.wicket.markup.html.border.BoxBorder</span><span class='o'>;</span>
 
+<span class='kd'>public</span> <span class='kd'>class</span> <span class='nc'>NavomaticBorder</span> <span class='kd'>extends</span> <span class='n'>Border</span> <span class='o'>{</span>
+    <span class='kd'>public</span> <span class='nf'>NavomaticBorder</span><span class='o'>(</span><span class='kd'>final</span> <span class='n'>String</span> <span class='n'>componentName</span><span class='o'>)</span> <span class='o'>{</span>
+        <span class='kd'>super</span><span class='o'>(</span><span class='n'>componentName</span><span class='o'>);</span>
+
+        <span class='n'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>BoxBorder</span><span class='o'>(</span><span class='s'>&quot;navigationBorder&quot;</span><span class='o'>));</span>
+        <span class='n'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>BoxBorder</span><span class='o'>(</span><span class='s'>&quot;bodyBorder&quot;</span><span class='o'>));</span>
+    <span class='o'>}</span>
+<span class='o'>}</span>
+</code></pre>
+</div>
+<h3 id='navomaticborderhtml'>NavomaticBorder.html</h3>
+<div class='highlight'><pre><code class='html'><span class='nt'>&lt;html&gt;</span>
+<span class='nt'>&lt;body&gt;</span>
+    <span class='nt'>&lt;wicket:border&gt;</span> 
+        <span class='nt'>&lt;p&gt;</span>
+        <span class='nt'>&lt;table&gt;</span>
+            <span class='nt'>&lt;tr&gt;</span>
+                <span class='nt'>&lt;td&gt;</span>
+                    <span class='nt'>&lt;span</span> <span class='na'>wicket:id =</span><span class='err'> </span><span class='s'>&quot;navigationBorder&quot;</span><span class='nt'>&gt;</span>
+                      <span class='nt'>&lt;b&gt;</span>Navigation Links<span class='nt'>&lt;/b&gt;</span>
+                      <span class='nt'>&lt;p&gt;</span>
+                        <span class='nt'>&lt;wicket:link&gt;</span>
+                          <span class='nt'>&lt;a</span> <span class='na'>href =</span><span class='err'> </span><span class='s'>&quot;Page1.html&quot;</span><span class='nt'>&gt;</span>Page1<span class='nt'>&lt;/a&gt;&lt;br/&gt;</span>
+                          <span class='nt'>&lt;a</span> <span class='na'>href =</span><span class='err'> </span><span class='s'>&quot;Page2.html&quot;</span><span class='nt'>&gt;</span>Page2<span class='nt'>&lt;/a&gt;&lt;br/&gt;</span>
+                          <span class='nt'>&lt;a</span> <span class='na'>href =</span><span class='err'> </span><span class='s'>&quot;Page3.html&quot;</span><span class='nt'>&gt;</span>Page3<span class='nt'>&lt;/a&gt;</span>
+                        <span class='nt'>&lt;/wicket:link&gt;</span>
+                      <span class='nt'>&lt;/p&gt;</span>
+                    <span class='nt'>&lt;/span&gt;</span>
+                <span class='nt'>&lt;/td&gt;</span>
+                <span class='nt'>&lt;td&gt;</span>
+                    <span class='nt'>&lt;span</span> <span class='na'>wicket:id =</span><span class='err'> </span><span class='s'>&quot;bodyBorder&quot;</span><span class='nt'>&gt;</span>
+                        <span class='nt'>&lt;wicket:body/&gt;</span>
+                    <span class='nt'>&lt;/span&gt;</span>
+                <span class='nt'>&lt;/td&gt;</span>
+            <span class='nt'>&lt;/tr&gt;</span>
+        <span class='nt'>&lt;/table&gt;</span>
+        <span class='nt'>&lt;/p&gt;</span>
+    <span class='nt'>&lt;/wicket:border&gt;</span>
+ <span class='nt'>&lt;/body&gt;</span>
+<span class='nt'>&lt;/html&gt;</span>
+</code></pre>
+</div>
 <p>Notice that the markup above encloses the entire contents of the markup file&#8217;s <code>&lt;body&gt;</code> with a <code>&lt;wicket:border&gt;</code> tag, as we described earlier. This lets the NavomaticBorder know how much of its markup to use when it wraps itself around the markup it finds in the context where it is used. Notice also the <code>&lt;wicket:body/&gt;</code> marker which designates where to put whatever is found inside the tag at the use context.</p>
 
 <p>Next, notice that the navigation links and the border&#8217;s <code>&lt;wicket:body/&gt;</code> are both enclosed in <code>&lt;span&gt;</code> tags which have wicket:id attributes that associate those tags with the BoxBorder components added in the NavomaticBorder constructor. These nested border components will each draw a thin black line around their contents.</p>
@@ -211,6 +322,21 @@
 <h3 id='webxml'>web.xml</h3>
 
 <p>In order to get this application up and running, we need to register the application with the Wicket servlet in the web.xml file. The following sections need to be added to the web.xml in the WEB-INF folder.</p>
+<div class='highlight'><pre><code class='xml'><span class='nt'>&lt;servlet&gt;</span>
+    <span class='nt'>&lt;servlet-name&gt;</span>NavomaticApplication<span class='nt'>&lt;/servlet-name&gt;</span>
+    <span class='nt'>&lt;servlet-class&gt;</span>org.apache.wicket.protocol.http.WicketServlet<span class='nt'>&lt;/servlet-class&gt;</span>
+    <span class='nt'>&lt;init-param&gt;</span>
+        <span class='nt'>&lt;param-name&gt;</span>applicationClassName<span class='nt'>&lt;/param-name&gt;</span>
+        <span class='nt'>&lt;param-value&gt;</span>wicket.examples.navomatic.NavomaticApplication<span class='nt'>&lt;/param-value&gt;</span>
+    <span class='nt'>&lt;/init-param&gt;</span>
+    <span class='nt'>&lt;load-on-startup&gt;</span>1<span class='nt'>&lt;/load-on-startup&gt;</span>
+<span class='nt'>&lt;/servlet&gt;</span>
+<span class='nt'>&lt;servlet-mapping&gt;</span>
+    <span class='nt'>&lt;servlet-name&gt;</span>NavomaticApplication<span class='nt'>&lt;/servlet-name&gt;</span>
+    <span class='nt'>&lt;url-pattern&gt;</span>/app/*<span class='nt'>&lt;/url-pattern&gt;</span>
+<span class='nt'>&lt;/servlet-mapping&gt;</span>
+</code></pre>
+</div>
 		</div>
         <div id="clearer"></div>
 		<div id="footer"><span>

Modified: wicket/common/site/trunk/_site/learn/examples/usingfragments.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/examples/usingfragments.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/examples/usingfragments.html (original)
+++ wicket/common/site/trunk/_site/learn/examples/usingfragments.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>
@@ -153,17 +153,86 @@
 <h2 id='creating_a_fragment'>Creating a Fragment</h2>
 
 <p>First things first, let&#8217;s create a page that we can add our fragments to. We will add a Loop that will repeat markup and choose a different Fragment for each item in the loop.</p>
-
+<div class='highlight'><pre><code class='html'><span class='nt'>&lt;html&gt;</span>
+<span class='nt'>&lt;head&gt;&lt;/head&gt;</span>
+<span class='nt'>&lt;body&gt;</span>
+<span class='nt'>&lt;ul&gt;</span>
+<span class='nt'>&lt;li</span> <span class='na'>wicket:id=</span><span class='s'>&quot;list&quot;</span><span class='nt'>&gt;&lt;span</span> <span class='na'>wicket:id=</span><span class='s'>&quot;panel&quot;</span><span class='nt'>&gt;&lt;/span&gt;&lt;/li&gt;</span>
+<span class='nt'>&lt;/ul&gt;</span>
+<span class='nt'>&lt;wicket:fragment</span> <span class='na'>wicket:id=</span><span class='s'>&quot;fragment1&quot;</span><span class='nt'>&gt;</span>panel 1<span class='nt'>&lt;/wicket:fragment&gt;</span>
+<span class='nt'>&lt;wicket:fragment</span> <span class='na'>wicket:id=</span><span class='s'>&quot;fragment2&quot;</span><span class='nt'>&gt;</span>panel 2<span class='nt'>&lt;/wicket:fragment&gt;</span>
+<span class='nt'>&lt;/body&gt;</span>
+<span class='nt'>&lt;/html&gt;</span>
+</code></pre>
+</div>
 <p>As you can see in this markup file, we already took care of adding the fragment markup to the page in the <code>&lt;wicket:fragment&gt;</code> tags. Each fragment can contain its own markup and components. Those components need to be added to the Fragment instance in the Java file, just as you would do with a panel and web markup container.</p>
+<div class='highlight'><pre><code class='java'><span class='kn'>package</span> <span class='n'>wicket</span><span class='o'>.</span><span class='na'>quickstart</span><span class='o'>;</span>
 
+<span class='kn'>import</span> <span class='nn'>wicket.markup.html.list.Loop</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>wicket.markup.html.panel.Fragment</span><span class='o'>;</span>
+
+<span class='kd'>public</span> <span class='kd'>class</span> <span class='nc'>Index</span> <span class='kd'>extends</span> <span class='n'>QuickStartPage</span> <span class='o'>{</span>
+    <span class='kd'>public</span> <span class='nf'>Index</span><span class='o'>()</span> <span class='o'>{</span>
+        <span class='n'>Loop</span> <span class='n'>loop</span> <span class='o'>=</span> <span class='k'>new</span> <span class='n'>Loop</span><span class='o'>(</span><span class='s'>&quot;list&quot;</span><span class='o'>,</span> <span class='mi'>5</span><span class='o'>)</span> <span class='o'>{</span>
+            <span class='kd'>protected</span> <span class='kt'>void</span> <span class='nf'>populateItem</span><span class='o'>(</span><span class='n'>LoopItem</span> <span class='n'>item</span><span class='o'>)</span> <span class='o'>{</span>
+                <span class='n'>String</span> <span class='n'>fragmentId</span> <span class='o'>=</span> <span class='s'>&quot;fragment&quot;</span> <span class='o'>+</span> <span class='o'>(</span><span class='n'>item</span><span class='o'>.</span><span class='na'>getIteration</span><span class='o'>()</span> <span class='o'>%</span> <span class='mi'>2</span> <span class='o'>+</span> <span class='mi'>1</span><span class='o'>);</span>
+                <span class='n'>item</span><span class='o'>.</span><span class='na'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>Fragment</span><span class='o'>(</span><span class='s'>&quot;panel&quot;</span><span class='o'>,</span> <span class='n'>fragmentId</span><span class='o'>));</span>
+            <span class='o'>}</span>
+        <span class='o'>};</span>
+        <span class='n'>add</span><span class='o'>(</span><span class='n'>loop</span><span class='o'>);</span>
+    <span class='o'>}</span>
+<span class='o'>}</span>
+</code></pre>
+</div>
 <p>The Loop will render 5 items, and the <code>populateItem</code> method will be called for each item. In each item we construct a fragment identifier that corresponds to the identifier in the <code>&lt;wicket:fragment&gt;</code>. The Fragment constructor takes the identifier of the markup it needs to attach to, and the fragment identifier telling it where to find the specific markup in the file.</p>
 
 <h2 id='adding_components_to_fragments'>Adding components to fragments</h2>
 
 <p>In the previous example we just showed different markup for each fragment, but you can add components to the fragments as well. Let&#8217;s add a label to fragment 1.</p>
-
+<div class='highlight'><pre><code class='html'><span class='nt'>&lt;html&gt;</span>
+<span class='nt'>&lt;head&gt;&lt;/head&gt;</span>
+<span class='nt'>&lt;body&gt;</span>
+<span class='nt'>&lt;ul&gt;</span>
+<span class='nt'>&lt;li</span> <span class='na'>wicket:id=</span><span class='s'>&quot;list&quot;</span><span class='nt'>&gt;&lt;span</span> <span class='na'>wicket:id=</span><span class='s'>&quot;panel&quot;</span><span class='nt'>&gt;&lt;/span&gt;&lt;/li&gt;</span>
+<span class='nt'>&lt;/ul&gt;</span>
+<span class='nt'>&lt;wicket:fragment</span> <span class='na'>wicket:id=</span><span class='s'>&quot;fragment1&quot;</span><span class='nt'>&gt;</span>panel 1 <span class='nt'>&lt;span</span> <span class='na'>wicket:id=</span><span class='s'>&quot;label&quot;</span><span class='nt'>&gt;&lt;/span&gt;&lt;/wicket:fragment&gt;</span>
+<span class='nt'>&lt;wicket:fragment</span> <span class='na'>wicket:id=</span><span class='s'>&quot;fragment2&quot;</span><span class='nt'>&gt;</span>panel 2<span class='nt'>&lt;/wicket:fragment&gt;</span>
+<span class='nt'>&lt;/body&gt;</span>
+<span class='nt'>&lt;/html&gt;</span>
+</code></pre>
+</div>
 <p>In order to add the component to the first fragment we&#8217;ll introduce a subclass for fragment one to encapsulate the component.</p>
+<div class='highlight'><pre><code class='java'><span class='kn'>package</span> <span class='n'>wicket</span><span class='o'>.</span><span class='na'>quickstart</span><span class='o'>;</span>
 
+<span class='kn'>import</span> <span class='nn'>wicket.markup.html.basic.Label</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>wicket.markup.html.list.Loop</span><span class='o'>;</span>
+<span class='kn'>import</span> <span class='nn'>wicket.markup.html.panel.Fragment</span><span class='o'>;</span>
+
+<span class='kd'>public</span> <span class='kd'>class</span> <span class='nc'>Index</span> <span class='kd'>extends</span> <span class='n'>QuickStartPage</span> <span class='o'>{</span>
+    <span class='kd'>public</span> <span class='kd'>class</span> <span class='nc'>Fragment1</span> <span class='kd'>extends</span> <span class='n'>Fragment</span> <span class='o'>{</span>
+        <span class='kd'>public</span> <span class='nf'>Fragment1</span><span class='o'>(</span><span class='n'>String</span> <span class='n'>id</span><span class='o'>,</span> <span class='n'>String</span> <span class='n'>markupId</span><span class='o'>)</span> <span class='o'>{</span>
+            <span class='kd'>super</span><span class='o'>(</span><span class='n'>id</span><span class='o'>,</span> <span class='n'>markupId</span><span class='o'>);</span>
+            <span class='n'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>Label</span><span class='o'>(</span><span class='s'>&quot;label&quot;</span><span class='o'>,</span> <span class='s'>&quot;Hello, World!&quot;</span><span class='o'>));</span>
+        <span class='o'>}</span>
+    <span class='o'>}</span>
+
+    <span class='kd'>public</span> <span class='nf'>Index</span><span class='o'>()</span> <span class='o'>{</span>
+        <span class='n'>Loop</span> <span class='n'>loop</span> <span class='o'>=</span> <span class='k'>new</span> <span class='n'>Loop</span><span class='o'>(</span><span class='s'>&quot;list&quot;</span><span class='o'>,</span> <span class='mi'>5</span><span class='o'>)</span> <span class='o'>{</span>
+            <span class='kd'>protected</span> <span class='kt'>void</span> <span class='nf'>populateItem</span><span class='o'>(</span><span class='n'>LoopItem</span> <span class='n'>item</span><span class='o'>)</span> <span class='o'>{</span>
+                <span class='kt'>int</span> <span class='n'>index</span> <span class='o'>=</span> <span class='o'>(</span><span class='n'>item</span><span class='o'>.</span><span class='na'>getIteration</span><span class='o'>()</span> <span class='o'>%</span> <span class='mi'>2</span> <span class='o'>+</span> <span class='mi'>1</span><span class='o'>);</span>
+                <span class='n'>String</span> <span class='n'>fragmentId</span> <span class='o'>=</span> <span class='s'>&quot;fragment&quot;</span> <span class='o'>+</span> <span class='n'>index</span><span class='o'>;</span>
+                <span class='k'>if</span> <span class='o'>(</span><span class='n'>index</span> <span class='o'>==</span> <span class='mi'>1</span><span class='o'>)</span> <span class='o'>{</span>
+                    <span class='n'>item</span><span class='o'>.</span><span class='na'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>Fragment1</span><span class='o'>(</span><span class='s'>&quot;panel&quot;</span><span class='o'>,</span> <span class='n'>fragmentId</span><span class='o'>));</span>
+                <span class='o'>}</span> <span class='k'>else</span> <span class='o'>{</span>
+                    <span class='n'>item</span><span class='o'>.</span><span class='na'>add</span><span class='o'>(</span><span class='k'>new</span> <span class='n'>Fragment</span><span class='o'>(</span><span class='s'>&quot;panel&quot;</span><span class='o'>,</span> <span class='n'>fragmentId</span><span class='o'>));</span>
+                <span class='o'>}</span>
+            <span class='o'>}</span>
+        <span class='o'>};</span>
+        <span class='n'>add</span><span class='o'>(</span><span class='n'>loop</span><span class='o'>);</span>
+    <span class='o'>}</span>
+<span class='o'>}</span>
+</code></pre>
+</div>
 <p>The class <code>Fragment1</code> adds the label to itself. In the loop&#8217;s <code>populateItem</code> we alternate the fragments type between <code>Fragment</code> and <code>Fragment1</code>. This means that in the final page on one line you&#8217;ll see <code>&quot;panel 1 Hello, World!&quot;</code> and on the other line just <code>&quot;panel 2&quot;</code>.</p>
 
 <h2 id='summary'>Summary</h2>

Modified: wicket/common/site/trunk/_site/learn/ides.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/ides.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/ides.html (original)
+++ wicket/common/site/trunk/_site/learn/ides.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>

Modified: wicket/common/site/trunk/_site/learn/index.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/index.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/index.html (original)
+++ wicket/common/site/trunk/_site/learn/index.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>

Modified: wicket/common/site/trunk/_site/learn/projects/authroles.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/projects/authroles.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/projects/authroles.html (original)
+++ wicket/common/site/trunk/_site/learn/projects/authroles.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>
@@ -195,7 +195,12 @@
 <h3 id='authorization'>Authorization</h3>
 
 <p>Annotation for configuring what roles are allowed for instantiation the annotated component or package. This annotation can be used for classes and packages, and can be used like this:</p>
-
+<div class='highlight'><pre><code class='java'><span class='c1'>// only users with role ADMIN are allowed to create instances of this page, whether it is</span>
+<span class='c1'>// either bookmarkable or not</span>
+<span class='nd'>@AuthorizeInstantiation</span><span class='o'>(</span><span class='s'>&quot;ADMIN&quot;</span><span class='o'>)</span>
+<span class='kd'>public</span> <span class='kd'>class</span> <span class='nc'>AdminAnnotationsBookmarkablePage</span> <span class='kd'>extends</span> <span class='n'>WebPage</span>
+</code></pre>
+</div>
 <p>When someone who doesn&#8217;t have the role ADMIN, Wicket will not allow the page to be fully constructed and throw an authorization exception during the construction of the page. This will result in an access denied page for the user.</p>
 
 <p>Enablng the annotations for role based authorization is done by setting the <code>WebApplication#getSecuritySettings</code> value to <code>AnnotationsRoleAuthorizationStrategy</code>. Then you can use the auth/roles provided authorization annotations.</p>
@@ -225,7 +230,13 @@
 <h3 id='using_maven'>Using Maven</h3>
 
 <p>Add the following dependency to your pom:</p>
-
+<div class='highlight'><pre><code class='xml'><span class='nt'>&lt;dependency&gt;</span>
+    <span class='nt'>&lt;groupId&gt;</span>org.apache.wicket<span class='nt'>&lt;/groupId&gt;</span>
+    <span class='nt'>&lt;artifactId&gt;</span>wicket-auth-roles<span class='nt'>&lt;/artifactId&gt;</span>
+    <span class='nt'>&lt;version&gt;</span>1.4.17<span class='nt'>&lt;/version&gt;</span>
+<span class='nt'>&lt;/dependency&gt;</span>
+</code></pre>
+</div>
 <h3 id='required_dependencies'>Required dependencies</h3>
 
 <p>Wicket Auth/Roles requires the following jar files to be on your classpath:</p>

Modified: wicket/common/site/trunk/_site/learn/projects/datetime.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/projects/datetime.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/projects/datetime.html (original)
+++ wicket/common/site/trunk/_site/learn/projects/datetime.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>

Modified: wicket/common/site/trunk/_site/learn/projects/devutils.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/projects/devutils.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/projects/devutils.html (original)
+++ wicket/common/site/trunk/_site/learn/projects/devutils.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>

Modified: wicket/common/site/trunk/_site/learn/projects/extensions.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/projects/extensions.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/projects/extensions.html (original)
+++ wicket/common/site/trunk/_site/learn/projects/extensions.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>

Modified: wicket/common/site/trunk/_site/learn/projects/guice.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/projects/guice.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/projects/guice.html (original)
+++ wicket/common/site/trunk/_site/learn/projects/guice.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>

Modified: wicket/common/site/trunk/_site/learn/projects/index.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/projects/index.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/projects/index.html (original)
+++ wicket/common/site/trunk/_site/learn/projects/index.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>

Modified: wicket/common/site/trunk/_site/learn/projects/ioc.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/projects/ioc.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/projects/ioc.html (original)
+++ wicket/common/site/trunk/_site/learn/projects/ioc.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>

Modified: wicket/common/site/trunk/_site/learn/projects/jmx.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/projects/jmx.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/projects/jmx.html (original)
+++ wicket/common/site/trunk/_site/learn/projects/jmx.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>

Modified: wicket/common/site/trunk/_site/learn/projects/spring.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/projects/spring.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/projects/spring.html (original)
+++ wicket/common/site/trunk/_site/learn/projects/spring.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>

Modified: wicket/common/site/trunk/_site/learn/projects/velocity.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/learn/projects/velocity.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/learn/projects/velocity.html (original)
+++ wicket/common/site/trunk/_site/learn/projects/velocity.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>
@@ -161,7 +161,16 @@
 <p>Velocity brings a templating language to your users. You can let them create conditional markup, use loops and do all other things made possible by Velocity.</p>
 
 <p>Velocity templates look like the following:</p>
+<div class='highlight'><pre><code class='html'>#set ($foo = &quot;deoxyribonucleic acid&quot;)
+#set ($bar = &quot;ribonucleic acid&quot;)
 
+#if ($foo == $bar)
+  In this case it&#39;s clear they aren&#39;t equivalent. So...
+#else
+  They are not equivalent and this will be the output.
+#end
+</code></pre>
+</div>
 <p>Read <a href='http://velocity.apache.org/engine/releases/velocity-1.4/user-guide.html'>more</a> about the Velocity template language.</p>
 
 <p>This project allows you to use Velocity templates as a component within your Wicket pages, and let them live next to Wicket components. A typical usecase would be to enable your users to embed Velocity templates in your application and using that as a type of portlet.</p>
@@ -171,15 +180,32 @@
 <h2 id='example'>Example</h2>
 
 <p>Showing Hello, World using Velocity in a Wicket application, embedded in a Wicket page.</p>
+<div class='highlight'><pre><code class='html'><span class='nt'>&lt;h2&gt;</span>This is a Velocity template<span class='nt'>&lt;/h2&gt;</span>
 
+<span class='nt'>&lt;p&gt;</span>The secret message is: $message<span class='nt'>&lt;/p&gt;</span>
+</code></pre>
+</div>
 <p>In this template we want to replace the string <code>$message</code> with the text &#8220;Hello, World!&#8221;. <code>$message</code> is Velocity markup denoting a variable that is taken from the context that is provided to the Velocity rendering engine.</p>
 
 <p>To use Velocity in your Wicket pages we provide a <code>VelocityPanel</code> which enables you to generate parts of your page using Velocity markup. Adding the panel to your Wicket page is shown in the following example:</p>
-
+<div class='highlight'><pre><code class='java'><span class='kd'>public</span> <span class='nf'>VelocityPage</span><span class='o'>()</span> <span class='o'>{</span>
+	<span class='n'>HashMap</span><span class='o'>&lt;</span><span class='n'>String</span><span class='o'>,</span> <span class='n'>String</span><span class='o'>&gt;</span> <span class='n'>values</span> <span class='o'>=</span> <span class='k'>new</span> <span class='n'>HashMap</span><span class='o'>&lt;</span><span class='n'>String</span><span class='o'>,</span> <span class='n'>String</span><span class='o'>&gt;();</span>
+	<span class='n'>values</span><span class='o'>.</span><span class='na'>put</span><span class='o'>(</span><span class='s'>&quot;message&quot;</span><span class='o'>,</span> <span class='s'>&quot;Hello, World!&quot;</span><span class='o'>);</span>
+	<span class='n'>Model</span><span class='o'>&lt;</span><span class='n'>HashMap</span><span class='o'>&lt;</span><span class='n'>String</span><span class='o'>,</span> <span class='n'>String</span><span class='o'>&gt;&gt;</span> <span class='n'>context</span> <span class='o'>=</span> <span class='n'>Model</span><span class='o'>.</span><span class='na'>of</span><span class='o'>(</span><span class='n'>values</span><span class='o'>);</span>
+	
+	<span class='n'>UrlResourceStream</span> <span class='n'>template</span> <span class='o'>=</span> <span class='k'>new</span> <span class='n'>UrlResourceStream</span><span class='o'>(</span><span class='n'>getClass</span><span class='o'>().</span><span class='na'>getResource</span><span class='o'>(</span><span class='s'>&quot;test.html&quot;</span><span class='o'>));</span>
+	<span class='n'>add</span><span class='o'>(</span><span class='n'>VelocityPanel</span><span class='o'>.</span><span class='na'>forTemplateResource</span><span class='o'>(</span><span class='s'>&quot;velocityPanel&quot;</span><span class='o'>,</span> <span class='n'>context</span><span class='o'>,</span> <span class='n'>template</span><span class='o'>));</span>
+<span class='o'>}</span>
+</code></pre>
+</div>
 <p><code>VelocityPanel.forTemplateResource</code> creates a <code>VelocityPanel</code> and sets up the engine such that the context is merged with the template with each render.</p>
 
 <p>The markup of the page is quite simple: adding a VelocityPanel is as simple as using a <code>div</code> and attaching a <code>wicket:identifier</code> to it. The following example shows this.</p>
-
+<div class='highlight'><pre><code class='html'><span class='cp'>&lt;!DOCTYPE html&gt;</span>
+<span class='nt'>&lt;h1&gt;</span>This is a test page for Velocity<span class='nt'>&lt;/h1&gt;</span>
+<span class='nt'>&lt;div</span> <span class='na'>wicket:id=</span><span class='s'>&quot;velocityPanel&quot;</span><span class='nt'>&gt;&lt;/div&gt;</span>
+</code></pre>
+</div>
 <h2 id='installing'>Installing</h2>
 
 <p>Installing Wicket Velocity can be done through adding a dependency in your project&#8217;s Maven pom, or by putting the wicket-velocity.jar and the required dependencies in your projects classpath.</p>
@@ -187,7 +213,13 @@
 <h3 id='using_maven'>Using Maven</h3>
 
 <p>Add the following dependency to your pom:</p>
-
+<div class='highlight'><pre><code class='xml'><span class='nt'>&lt;dependency&gt;</span>
+    <span class='nt'>&lt;groupId&gt;</span>org.apache.wicket<span class='nt'>&lt;/groupId&gt;</span>
+    <span class='nt'>&lt;artifactId&gt;</span>wicket-velocity<span class='nt'>&lt;/artifactId&gt;</span>
+    <span class='nt'>&lt;version&gt;</span>1.4.17<span class='nt'>&lt;/version&gt;</span>
+<span class='nt'>&lt;/dependency&gt;</span>
+</code></pre>
+</div>
 <h3 id='required_dependencies'>Required dependencies</h3>
 
 <p>Wicket Velocity requires the following jar files to be on your classpath:</p>

Modified: wicket/common/site/trunk/_site/meet/blogs.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/meet/blogs.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/meet/blogs.html (original)
+++ wicket/common/site/trunk/_site/meet/blogs.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>

Modified: wicket/common/site/trunk/_site/meet/buzz.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/meet/buzz.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/meet/buzz.html (original)
+++ wicket/common/site/trunk/_site/meet/buzz.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>

Modified: wicket/common/site/trunk/_site/meet/features.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/meet/features.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/meet/features.html (original)
+++ wicket/common/site/trunk/_site/meet/features.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>

Modified: wicket/common/site/trunk/_site/meet/index.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/meet/index.html?rev=1088238&r1=1088237&r2=1088238&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/meet/index.html (original)
+++ wicket/common/site/trunk/_site/meet/index.html Sun Apr  3 10:02:58 2011
@@ -86,7 +86,7 @@
 	</h5>
 	<ul>
 		<li>
-			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.16">Wicket 1.4</a>
+			<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.17">Wicket 1.4</a>
 			(<a href="http://wicket.apache.org/apidocs/1.4" title="JavaDocs of the latest stable release - 1.4.x">docs</a>)
 		</li>
 		<li>