You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by bu...@apache.org on 2015/07/19 23:21:30 UTC

svn commit: r958985 [27/29] - in /websites/production/tapestry/content: ./ 2009/09/13/ 2009/10/27/ 2009/11/25/ 2010/07/18/ 2010/07/24/ 2010/10/11/ 2010/10/31/ 2010/11/18/ 2010/12/16/ 2010/12/17/ 2011/01/18/ 2011/03/23/ 2011/03/29/ 2011/03/30/ 2011/03/3...

Modified: websites/production/tapestry/content/the-tapestry-jail.html
==============================================================================
--- websites/production/tapestry/content/the-tapestry-jail.html (original)
+++ websites/production/tapestry/content/the-tapestry-jail.html Sun Jul 19 21:21:27 2015
@@ -27,6 +27,14 @@
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
 
+    <link href='/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css' />
+  <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -65,9 +73,9 @@
 <p><strong>ONLY</strong> use</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 sudo /usr/local/etc/rc.d/tomcat7 restart
-]]></script>
+</pre>
 </div></div>
 
 <p>if you need to restart Tomcat. Anything else will fail.</p>
@@ -77,27 +85,27 @@ sudo /usr/local/etc/rc.d/tomcat7 restart
 <p>If the jail lost Java and Tomcat:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 cd /usr/ports
-]]></script>
+</pre>
 </div></div>
 
 <p>if it doesn't exist yet:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 portsnap fetch
 portsnap extract
-]]></script>
+</pre>
 </div></div>
 
 <p>install java:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 cd /usr/ports/java/diablo-jdk16/
 make install clean
-]]></script>
+</pre>
 </div></div>
 
 <p>Some files need manual download and have to be placed into <code>/usr/ports/distfiles</code>. Follow the instructions on screen.</p>
@@ -107,9 +115,9 @@ make install clean
 <p>Afterwards:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 make install clean
-]]></script>
+</pre>
 </div></div>
 
 <p>Follow instructions and manually install any unresolved dependencies it might encounter.</p>
@@ -121,27 +129,27 @@ make install clean
 <p>Check your env for PACKAGESITE. It should point to tb.apache.org:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 [root@tapestry ~]# env|grep PACKAGESITE
 PACKAGESITE=ftp://tb.apache.org/pub/FreeBSD/ports/packages/8.2-RELENG-j-tlp/Latest/
-]]></script>
+</pre>
 </div></div>
 
 <p>Install the tomcat7 package:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 pkg_add -r tomcat7
-]]></script>
+</pre>
 </div></div>
 
 <h5 id="Thetapestryjail-fromports(discouraged)">from ports (discouraged)</h5>
 <div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>this is really discouraged!</p></div></div>
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 cd /usr/ports/www/tomcat7
 make install clean
-]]></script>
+</pre>
 </div></div>
 
 <h5 id="Thetapestryjail-configuretomcat">configure tomcat</h5>
@@ -151,11 +159,11 @@ make install clean
 <p>Add</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-tomcat7_enable=&quot;YES&quot;
-tomcat7_java_home=&quot;/usr/local/diablo-jdk1.6.0/jre&quot;
-tomcat7_java_opts=&quot;-XX:MaxPermSize=256M&quot;
-]]></script>
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+tomcat7_enable="YES"
+tomcat7_java_home="/usr/local/diablo-jdk1.6.0/jre"
+tomcat7_java_opts="-XX:MaxPermSize=256M"
+</pre>
 </div></div>
 
 <p>to <code>/etc/rc.conf</code> to start tomcat on system startup and tell it to use the Diablo JVM.</p>
@@ -163,10 +171,10 @@ tomcat7_java_opts=&quot;-XX:MaxPermSize=
 <p>The sudoers file may have lost the entry allowing members of the tomcat-restart group to restart Tomcat. Add it back using <code>visudo</code>:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 # restart tomcat
 %tomcat-restart ALL=(root)      NOPASSWD: /usr/local/etc/rc.d/tomcat7 restart
-]]></script>
+</pre>
 </div></div></div>
 </div>
 

Modified: websites/production/tapestry/content/type-coercion.html
==============================================================================
--- websites/production/tapestry/content/type-coercion.html (original)
+++ websites/production/tapestry/content/type-coercion.html Sun Jul 19 21:21:27 2015
@@ -27,6 +27,16 @@
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
 
+    <link href='/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css' />
+  <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushPlain.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -57,18 +67,10 @@
   </div>
 
 <div id="content">
-<div id="ConfluenceContent"><style type="text/css">/*<![CDATA[*/
-table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color: #f0f0f0}
-table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
-table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
-table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
-table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
-table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}
-
-/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="service-serialization.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="service-serialization.html">Service Serialization</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="ioc.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/up_16.gif" width="8" height="8"></a></sup><a shape="rect" href="ioc.html">IoC</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;<a shape="rect" href="starting-the-ioc-registry.html">Starting the IoC Registry</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="starting-the-ioc-registry.html"
 ><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif" width="16" height="16"></a></td></tr></table></div><div class="navmenu" style="float:right; background:white; margin:3px; padding:3px">
+<div id="ConfluenceContent"><div class="navmenu" style="float:right; background:white; margin:3px; padding:3px">
 <div class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px"></div> 
-<div class="error"><span class="error">Error formatting macro: contentbylabel: com.atlassian.confluence.api.service.exceptions.BadRequestException: Could not parse cql : null</span> </div></div><p><strong>Type Coercion</strong> is the conversion of one type of object to a new object of a different type with similar content. Tapestry frequently must coerce objects from one type to another. A common example is the coercion of a string into an integer or a double.</p><p>Although type coercions happen more inside tapestry-core (including <a shape="rect" href="parameter-type-coercion.html">coercions of <span class="confluence-link">component parameters</span></a><span class="confluence-link">&#160;</span>), they may also happen inside tapestry-ioc, such as when injecting a value, rather than a service, into a builder method.</p><p>Like everything else in Tapestry, type coercions are extensible. At the root is the <a shape="rect" class="external-link" href="http://tapestry.apache.org/curr
 ent/apidocs/org/apache/tapestry5/ioc/services/TypeCoercer.html">TypeCoercer</a> service. Its configuration consists of a number of <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/CoercionTuple.html">CoercionTuples</a>. Each tuple defines how to coerce from one type to another. The initial set of coercions is focused primarily on coercions between different numeric types:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="type-coercion.data/type-coercer.png" data-image-src="/confluence/download/attachments/23338478/type-coercer.png?version=1&amp;modificationDate=1290973716000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24346935" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="type-coercer.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="im
 age/png" data-linked-resource-container-id="23338478" data-linked-resource-container-version="29"></span></p><h2 id="TypeCoercion-DefaultTypeCoercions">Default Type Coercions</h2><p>There are a few special coercions related to <code>null</code> there; <code>Object</code> --&gt; <code>List</code> wraps a lone object as a singleton list, we then need <code>null</code> --&gt; <code>List</code> to ensure that <code>null</code> stays <code>null</code> (rather than a singleton list whose lone element is a <code>null</code>).</p><p>Tapestry can <em>interpolate</em> necessary coercions. For example, say it is necessary to coerce a <code>StringBuffer</code> to an <code>Integer</code>; the TypeCoercer service will chain together a series of coercions:</p><ul><li><code>Object</code> --&gt; <code>String</code></li><li><code>String</code> --&gt; <code>Long</code></li><li><code>Long</code> --&gt; <code>Integer</code></li></ul><h2 id="TypeCoercion-Coercingfromnull">Coercing from null</h2><p>Coerci
 ng from <code>null</code> is special; it is not a spanning search as with the other types. Either there is a specific coercion from <code>null</code> to the desired type, or no coercion takes places (and the coerced value is <code>null</code>).</p><p>The only built-in <code>null</code> coercion is from <code>null</code> to <code>boolean</code> (which is always false).</p><h2 id="TypeCoercion-ListofCoercions">List of Coercions</h2><p>As of Tapestry versions 5.1 and 5.2, the following coercions are available:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[Double --&gt; Float
+<div class="error"><span class="error">Error formatting macro: contentbylabel: com.atlassian.confluence.api.service.exceptions.BadRequestException: Could not parse cql : null</span> </div></div><p><strong>Type Coercion</strong> is the conversion of one type of object to a new object of a different type with similar content. Tapestry frequently must coerce objects from one type to another. A common example is the coercion of a string into an integer or a double.</p><p>Although type coercions happen more inside tapestry-core (including <a shape="rect" href="parameter-type-coercion.html">coercions of <span class="confluence-link">component parameters</span></a><span class="confluence-link">&#160;</span>), they may also happen inside tapestry-ioc, such as when injecting a value, rather than a service, into a builder method.</p><p>Like everything else in Tapestry, type coercions are extensible. At the root is the <a shape="rect" class="external-link" href="http://tapestry.apache.org/curr
 ent/apidocs/org/apache/tapestry5/ioc/services/TypeCoercer.html">TypeCoercer</a> service. Its configuration consists of a number of <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/CoercionTuple.html">CoercionTuples</a>. Each tuple defines how to coerce from one type to another. The initial set of coercions is focused primarily on coercions between different numeric types:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="type-coercion.data/type-coercer.png"></span></p><h2 id="TypeCoercion-DefaultTypeCoercions">Default Type Coercions</h2><p>There are a few special coercions related to <code>null</code> there; <code>Object</code> --&gt; <code>List</code> wraps a lone object as a singleton list, we then need <code>null</code> --&gt; <code>List</code> to ensure that <code>null</code> stays <code>null</code> (rather than a singleton list whose lone element is a <code>nul
 l</code>).</p><p>Tapestry can <em>interpolate</em> necessary coercions. For example, say it is necessary to coerce a <code>StringBuffer</code> to an <code>Integer</code>; the TypeCoercer service will chain together a series of coercions:</p><ul><li><code>Object</code> --&gt; <code>String</code></li><li><code>String</code> --&gt; <code>Long</code></li><li><code>Long</code> --&gt; <code>Integer</code></li></ul><h2 id="TypeCoercion-Coercingfromnull">Coercing from null</h2><p>Coercing from <code>null</code> is special; it is not a spanning search as with the other types. Either there is a specific coercion from <code>null</code> to the desired type, or no coercion takes places (and the coerced value is <code>null</code>).</p><p>The only built-in <code>null</code> coercion is from <code>null</code> to <code>boolean</code> (which is always false).</p><h2 id="TypeCoercion-ListofCoercions">List of Coercions</h2><p>As of Tapestry versions 5.1 and 5.2, the following coercions are available:</
 p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">Double --&gt; Float
 Float --&gt; Double
 Long --&gt; Boolean
 Long --&gt; Byte
@@ -121,9 +123,9 @@ org.apache.tapestry5.Renderable --&gt; o
 org.apache.tapestry5.ioc.util.TimeInterval --&gt; Long
 org.apache.tapestry5.runtime.ComponentResourcesAware --&gt; org.apache.tapestry5.ComponentResources
 short[] --&gt; java.util.List
-]]></script>
+</pre>
 </div></div><h2 id="TypeCoercion-ContributingNewCoercions">Contributing New Coercions</h2><p>TypeCoercer is extensible; you may add new coercions as desired. For example, let's say you have a <code>Money</code> type that represents an amount of some currency, and you want to be able to convert from <code>BigDecimal</code> to <code>Money</code>. Further, let's assume that <code>Money</code> has a constructor that accepts a <code>BigDecimal</code> as its parameter. We'll use a little Tapestry IOC configuration jujitsu to inform the TypeCoercer about this coercion.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>AppModule.java (partial)</b></div><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public static void contributeTypeCoercer(Configuration&lt;CoercionTuple&gt; configuration)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">public static void contributeTypeCoercer(Configuration&lt;CoercionTuple&gt; configuration)
 {
     Coercion&lt;BigDecimal, Money&gt; coercion = new Coercion&lt;BigDecimal, Money&gt;()
     {
@@ -134,9 +136,9 @@ short[] --&gt; java.util.List
     };
  
     configuration.add(new CoercionTuple&lt;BigDecimal, Money&gt;(BigDecimal.class, Money.class, coercion));     
-}]]></script>
+}</pre>
 </div></div><p>Further, since TypeCoercer knows how to convert <code>Double</code> to <code>BigDecimal</code>, or even <code>Integer</code> (to <code>Long</code> to <code>Double</code>) to <code>BigDecimal</code>, all of those coercions would work as well.</p><p>When creating a coercion from <code>null</code>, use <code>Void.class</code> as the source type. For example, the built-in coercion from <code>null</code> to <code>Boolean</code> is implemented as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>AppModule.java (partial)</b></div><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    configuration.add(new CoercionTuple(void.class, Boolean.class,
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">    configuration.add(new CoercionTuple(void.class, Boolean.class,
         new Coercion&lt;Void, Boolean&gt;()
     {
         public Boolean coerce(Void input)
@@ -144,16 +146,8 @@ short[] --&gt; java.util.List
             return false;
         }
     }));
-]]></script>
-</div></div><style type="text/css">/*<![CDATA[*/
-table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color: #f0f0f0}
-table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
-table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
-table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
-table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
-table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}
-
-/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="service-serialization.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="service-serialization.html">Service Serialization</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="ioc.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/up_16.gif" width="8" height="8"></a></sup><a shape="rect" href="ioc.html">IoC</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;<a shape="rect" href="starting-the-ioc-registry.html">Starting the IoC Registry</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="starting-the-ioc-registry.html"
 ><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif" width="16" height="16"></a></td></tr></table></div></div>
+</pre>
+</div></div></div>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/unit-testing-pages-or-components.html
==============================================================================
--- websites/production/tapestry/content/unit-testing-pages-or-components.html (original)
+++ websites/production/tapestry/content/unit-testing-pages-or-components.html Sun Jul 19 21:21:27 2015
@@ -27,6 +27,16 @@
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
 
+    <link href='/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css' />
+  <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushPlain.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -76,18 +86,18 @@
 
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public class MyTest extends Assert
 {
     @Test
     public void test1()
     {
-        String appPackage = &quot;org.example.app&quot;;
-        String appName = &quot;App1&quot;; // App1Module.java has configured some services.
-        PageTester tester = new PageTester(appPackage, appName, &quot;src/main/webapp&quot;);
+        String appPackage = "org.example.app";
+        String appName = "App1"; // App1Module.java has configured some services.
+        PageTester tester = new PageTester(appPackage, appName, "src/main/webapp");
     }
 }
-]]></script>
+</pre>
 </div></div>
 <h2 id="Unittestingpagesorcomponents-Testingtherenderingofapage">Testing the rendering of a page</h2>
 
@@ -96,40 +106,40 @@ public class MyTest extends Assert
 <p>Here is an example. Let's assuming the page being tested is named "MyPage" and it should return a page containing an HTML element whose id is "id1" and whose text content should be "hello":</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public class MyTest extends Assert
 {
     @Test
     public void test1()
     {
-        String appPackage = &quot;org.example.app&quot;;
-        String appName = &quot;LocaleApp&quot;;
-        PageTester tester = new PageTester(appPackage, appName, &quot;src/main/webapp&quot;);
-        Document doc = tester.renderPage(&quot;MyPage&quot;);
-        assertEquals(doc.getElementById(&quot;id1&quot;).getChildText(), &quot;hello&quot;);
+        String appPackage = "org.example.app";
+        String appName = "LocaleApp";
+        PageTester tester = new PageTester(appPackage, appName, "src/main/webapp");
+        Document doc = tester.renderPage("MyPage");
+        assertEquals(doc.getElementById("id1").getChildText(), "hello");
     }
 }
-]]></script>
+</pre>
 </div></div>
 
 <p>If the page requires a context, you can pass it this way:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public class MyTest extends Assert
 {
     @Test
     public void test1()
     {
-        String appPackage = &quot;org.example.app&quot;;
-        String appName = &quot;LocaleApp&quot;;
-        PageTester tester = new PageTester(appPackage, appName, &quot;src/main/webapp&quot;);
-        Object[] context = new Object[]{ &quot;abc&quot;, 123 };
-        Document doc = tester.invoke(new ComponentInvocation(new PageLinkTarget(&quot;MyPage&quot;), context));
-        assertEquals(doc.getElementById(&quot;id1&quot;).getChildText(), &quot;hello&quot;);
+        String appPackage = "org.example.app";
+        String appName = "LocaleApp";
+        PageTester tester = new PageTester(appPackage, appName, "src/main/webapp");
+        Object[] context = new Object[]{ "abc", 123 };
+        Document doc = tester.invoke(new ComponentInvocation(new PageLinkTarget("MyPage"), context));
+        assertEquals(doc.getElementById("id1").getChildText(), "hello");
     }
 }
-]]></script>
+</pre>
 </div></div>
 
 <h2 id="Unittestingpagesorcomponents-Testinganactionlink">Testing an action link</h2>
@@ -137,22 +147,22 @@ public class MyTest extends Assert
 <p>After rendering a page, you may want to "click" on an action link and then assert against the resulting page. You can do it this way:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public class MyTest extends Assert
 {
     @Test
     public void test1()
     {
-        String appPackage = &quot;org.example.app&quot;;
-        String appName = &quot;LocaleApp&quot;;
-        PageTester tester = new PageTester(appPackage, appName, &quot;src/main/webapp&quot;);
-        Document doc = tester.renderPage(&quot;MyPage&quot;);
-        Element link = doc.getElementById(&quot;link1&quot;);
+        String appPackage = "org.example.app";
+        String appName = "LocaleApp";
+        PageTester tester = new PageTester(appPackage, appName, "src/main/webapp");
+        Document doc = tester.renderPage("MyPage");
+        Element link = doc.getElementById("link1");
         doc = tester.clickLink(link);
-        assertTrue(doc.toString().contains(&quot;abc&quot;));
+        assertTrue(doc.toString().contains("abc"));
     }
 }
-]]></script>
+</pre>
 </div></div>
 
 <h2 id="Unittestingpagesorcomponents-Testingaformsubmission">Testing a form submission</h2>
@@ -160,25 +170,25 @@ public class MyTest extends Assert
 <p>After rendering a page, you may want to fill out a form, submit it and then inspect the resulting page. You can do it this way:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public class MyTest extends Assert
 {
     @Test
     public void test1()
     {
-        String appPackage = &quot;org.example.app&quot;;
-        String appName = &quot;LocaleApp&quot;;
-        PageTester tester = new PageTester(appPackage, appName, &quot;src/main/webapp&quot;);
-        Document doc = tester.renderPage(&quot;MyPage&quot;);
-        Element form = doc.getElementById(&quot;form1&quot;);
+        String appPackage = "org.example.app";
+        String appName = "LocaleApp";
+        PageTester tester = new PageTester(appPackage, appName, "src/main/webapp");
+        Document doc = tester.renderPage("MyPage");
+        Element form = doc.getElementById("form1");
         Map&lt;String, String&gt; fieldValues = new HashMap&lt;String, String&gt;();
-        fieldValues.put(&quot;field1&quot;, &quot;hello&quot;);
-        fieldValues.put(&quot;field2&quot;, &quot;100&quot;);
+        fieldValues.put("field1", "hello");
+        fieldValues.put("field2", "100");
         doc = tester.submitForm(form, fieldValues);
-        assertTrue(doc.toString().contains(&quot;abc&quot;));
+        assertTrue(doc.toString().contains("abc"));
     }
 }
-]]></script>
+</pre>
 </div></div>
 
 <p>To submit a form by clicking a submit button, call the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/test/PageTester.html#clickSubmit(org.apache.tapestry5.dom.Element,%20java.util.Map)">clickSubmit()</a> method instead.</p>

Modified: websites/production/tapestry/content/uploading-files.html
==============================================================================
--- websites/production/tapestry/content/uploading-files.html (original)
+++ websites/production/tapestry/content/uploading-files.html Sun Jul 19 21:21:27 2015
@@ -27,6 +27,16 @@
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
 
+    <link href='/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css' />
+  <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushPlain.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -58,46 +68,46 @@
 
 <div id="content">
 <div id="ConfluenceContent"><p>Tapestry provides a file upload component based on <a shape="rect" class="external-link" href="http://commons.apache.org/fileupload/">Apache Commons FileUpload</a> to make it easier to handle files uploaded through web forms (via the standard &lt;input type="file"&gt; HTML element).</p><h1 id="UploadingFiles-Downloading">Downloading</h1><p><strong>tapestry-upload</strong> is not automatically included in Tapestry applications because of the additional dependencies it requires. To include it, just add the <code>tapestry-upload</code> dependency to the pom of your application, something like this:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;dependency&gt;
     &lt;groupId&gt;org.apache.tapestry&lt;/groupId&gt;
     &lt;artifactId&gt;tapestry-upload&lt;/artifactId&gt;
     &lt;version&gt;${tapestry-release-version}&lt;/version&gt;
 &lt;/dependency&gt;
-]]></script>
+</pre>
 </div></div><p>If you aren't using Maven, you'll have to download the jar and its dependencies yourself.</p><h1 id="UploadingFiles-Usage">Usage</h1><p>The upload component supports default value binding (based on id) and validation.</p><div class="navmenu" style="float:right; background:#eee; margin:3px; padding:0 1em">
 <p>    <strong>JumpStart Demo:</strong><br clear="none">
     <a shape="rect" class="external-link" href="http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/fileupload" >File Upload</a></p></div><h2 id="UploadingFiles-ComponentTemplate">Component Template</h2><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    &lt;t:form&gt;
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">    &lt;t:form&gt;
         &lt;t:errors/&gt;
-        &lt;input t:type=&quot;upload&quot; t:id=&quot;file&quot; t:value=&quot;file&quot; validate=&quot;required&quot;/&gt;
+        &lt;input t:type="upload" t:id="file" t:value="file" validate="required"/&gt;
         &lt;br/&gt;
-        &lt;input type=&quot;submit&quot; value=&quot;Upload&quot;/&gt;
-    &lt;/t:form&gt;]]></script>
+        &lt;input type="submit" value="Upload"/&gt;
+    &lt;/t:form&gt;</pre>
 </div></div><p>Here, because the value parameter was not bound, the component used the file property of its container (because the component's id is 'file'). If you want to upload as a different property, either bind the value parameter or change the component's id.</p><h2 id="UploadingFiles-Pageclass">Page class</h2><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    public class UploadExample
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">    public class UploadExample
     {
         @Property
         private UploadedFile file;
 
         public void onSuccess()
         {
-            File copied = new File(&quot;/my/file/location/&quot; + file.getFileName());
+            File copied = new File("/my/file/location/" + file.getFileName());
             
             file.write(copied);
         }
-    }]]></script>
+    }</pre>
 </div></div><h1 id="UploadingFiles-UploadExceptions">Upload Exceptions</h1><p>In some cases, file uploads may fail. This can be because of a simple communication exception, or more likely, because the configured maximum upload size was exceeded.</p><p>When a file upload exception occurs, Tapestry will trigger a "uploadException" event on the page to notify it of the error. All other normal processing is skipped (no "activate" event, no form submission, etc.).</p><p>The event handler should return a non-null object, which will be handled as a navigational result. Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[   @Persist(PersistenceConstants.FLASH)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">   @Persist(PersistenceConstants.FLASH)
     @Property
     private String message;
 
 
     Object onUploadException(FileUploadException ex)
     {
-        message = &quot;Upload exception: &quot; + ex.getMessage();
+        message = "Upload exception: " + ex.getMessage();
 
         return this;
-    }]]></script>
+    }</pre>
 </div></div><p>Note the importance of <code>return this;</code>. A void event handler method, or one that returns null, will result in the FileUploadException being reported to the user as an uncaught runtime exception.</p><h1 id="UploadingFiles-Configuration">Configuration</h1><p>Four values may be configured as <a shape="rect" href="symbols.html">symbols</a>:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>upload.repository-location</p></th><td colspan="1" rowspan="1" class="confluenceTd"><p>The directory to which files that are too large to keep in memory will be written to. The default is from the java.io.tmpdir system property.</p></td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>upload.repository-threshold</p></th><td colspan="1" rowspan="1" class="confluenceTd"><p>Upload size, in bytes, at which point the uploaded file is written to disk rather than kept in memory. The default is 10 kilob
 ytes.</p></td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>upload.requestsize-max</p></th><td colspan="1" rowspan="1" class="confluenceTd"><p>Maximim size, in bytes, for the overall request. If exceeded, a FileUploadException will occur. The default is no maximum.</p></td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>upload.filesize-max</p></th><td colspan="1" rowspan="1" class="confluenceTd"><p>Maximum size, in bytes, for any individual uploaded file. Again, a FileUploadException will occur if exceeded. The default is no maximum.</p></td></tr></tbody></table></div><p>The class <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/upload/services/UploadSymbols.html">UploadSymbols</a> defines constants for all four of these.</p><h1 id="UploadingFiles-PotentialIssues">Potential Issues</h1><p>The Commons FileUpload library uses the CommonsIO file cleaner service to remove temporary files when they are 
 no longer needed. This service creates a thread to carry out its work. If the commons-io library is shared amongst multiple applications (e.g. added to server classpath) it is possible for an application to terminate this thread prematurely and cause errors for the other applications. (see the <a shape="rect" class="external-link" href="http://jakarta.apache.org/commons/fileupload/using.html">Resource Cleanup</a> section in for more discussion)</p><p>Technically the file cleanup service is not needed by Tapestry Upload (which deletes temporary files at the end of request processing). However it is currently not possible to disable it (enhancement request has been filed as <a shape="rect" class="external-link" href="https://issues.apache.org/jira/browse/FILEUPLOAD-133">FILEUPLOAD-133</a>).</p></div>
 </div>
 

Modified: websites/production/tapestry/content/url-rewriting.html
==============================================================================
--- websites/production/tapestry/content/url-rewriting.html (original)
+++ websites/production/tapestry/content/url-rewriting.html Sun Jul 19 21:21:27 2015
@@ -27,6 +27,14 @@
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
 
+    <link href='/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css' />
+  <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -77,7 +85,7 @@
 <p>This example just rewrites all incoming requests to <code>/struts</code> to <code>/tapestry</code>. In your <code>AppModule</code> or any other Tapestry-IoC module class:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public static void contributeURLRewriter(OrderedConfiguration&lt;URLRewriterRule&gt; configuration)
 {
     
@@ -87,9 +95,9 @@ public static void contributeURLRewriter
         public Request process(Request request, URLRewriteContext context)
         {
             final String path = request.getPath();
-            if (path.equals(&quot;/struts&quot;))
+            if (path.equals("/struts"))
             {
-                request = new SimpleRequestWrapper(request, &quot;/tapestry&quot;);
+                request = new SimpleRequestWrapper(request, "/tapestry");
             }
             
             return request;
@@ -103,9 +111,9 @@ public static void contributeURLRewriter
         
     };
     
-    configuration.add(&quot;myrule&quot;, rule);
+    configuration.add("myrule", rule);
 }
-]]></script>
+</pre>
 </div></div>
 
 <h2 id="URLrewriting-Exampleofrulechaining">Example of rule chaining</h2>
@@ -113,7 +121,7 @@ public static void contributeURLRewriter
 <p>In your <code>AppModule</code> or any other Tapestry-IoC module class.</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public static void contributeURLRewriter(OrderedConfiguration&lt;URLRewriterRule&gt; configuration)
 {
     
@@ -123,9 +131,9 @@ public static void contributeURLRewriter
         public Request process(Request request, URLRewriteContext context)
         {
             final String path = request.getPath();
-            if (path.equals(&quot;/struts&quot;)) 
+            if (path.equals("/struts")) 
             {
-                request = new SimpleRequestWrapper(request, &quot;/jsf&quot;);
+                request = new SimpleRequestWrapper(request, "/jsf");
             }
             
             return request;
@@ -145,9 +153,9 @@ public static void contributeURLRewriter
         public Request process(Request request, URLRewriteContext context)
         {
             final String path = request.getPath();
-            if (path.equals(&quot;/jsf&quot;)) 
+            if (path.equals("/jsf")) 
             {
-                request = new SimpleRequestWrapper(request, &quot;/tapestry&quot;);
+                request = new SimpleRequestWrapper(request, "/tapestry");
             }
             return request;
             
@@ -166,9 +174,9 @@ public static void contributeURLRewriter
         public Request process(Request request, URLRewriteContext context)
         {
             String path = request.getPath();
-            if (path.equals(&quot;/tapestry&quot;)) 
+            if (path.equals("/tapestry")) 
             {
-                path = &quot;/urlrewritesuccess&quot;;
+                path = "/urlrewritesuccess";
                 request = new SimpleRequestWrapper(request, path);
             }
             return request;
@@ -189,10 +197,10 @@ public static void contributeURLRewriter
         {
             String serverName = request.getServerName();
             String path = request.getPath();
-            final String pathToRewrite = &quot;/urlrewritesuccess/login&quot;;
-            if (serverName.equals(&quot;localhost&quot;) &amp;&amp; path.equalsIgnoreCase(pathToRewrite)) 
+            final String pathToRewrite = "/urlrewritesuccess/login";
+            if (serverName.equals("localhost") &amp;&amp; path.equalsIgnoreCase(pathToRewrite)) 
             {
-                request = new SimpleRequestWrapper(request, &quot;http://login.domain.com&quot;, &quot;/&quot;);
+                request = new SimpleRequestWrapper(request, "http://login.domain.com", "/");
             }
             return request;
             
@@ -206,13 +214,13 @@ public static void contributeURLRewriter
 
     };    
     
-    configuration.add(&quot;rule1&quot;, rule1);
-    configuration.add(&quot;rule2&quot;, rule2, &quot;after:rule1&quot;);
-    configuration.add(&quot;rule3&quot;, rule3, &quot;after:rule2&quot;);
-    configuration.add(&quot;rule4&quot;, rule4);
+    configuration.add("rule1", rule1);
+    configuration.add("rule2", rule2, "after:rule1");
+    configuration.add("rule3", rule3, "after:rule2");
+    configuration.add("rule4", rule4);
     
 }
-]]></script>
+</pre>
 </div></div>
 
 <p>This examples shows the URL rewriting chaining: the first rule rewrites requests to <code>/struts</code> and rewrites them to <code>/jsf</code> and leaves requests to other URLs unchanged. The second rewrites <code>/jsf</code> to <code>/tapestry</code> and the third rewrites <code>/tapestry</code> to <code>/urlrewritesuccess</code>.</p>
@@ -224,7 +232,7 @@ public static void contributeURLRewriter
 <p>The URLRewriteContext (added in 5.1.0.4) provides additional information for rewriting, particularly in the context of rewriting generated link urls. In the following example, we'll reconfigure the url used to render pages. Whereas the previous examples used separate rules for handling inbound and outbound rewriting, this demonstration will utilize a single rule for both scenarios. To simplify the example, we will assume that every page is named "XXXPage" (UserPage, TransactionPage, IndexPage, etc.). This naming convention also means that we don't have to worry about tapestry's auto-stripping of "index" from URLs, because our page would be IndexPage, rather than Index.</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public static void contributeURLRewriter(OrderedConfiguration&lt;URLRewriterRule&gt; configuration)
 {
     URLRewriterRule rule = new URLRewriterRule() 
@@ -233,13 +241,13 @@ public static void contributeURLRewriter
         {
             if (context.isIncoming())
             {
-                //these look like component event requests, which we didn&#39;t rewrite, so ignore.
-                if (request.getPath().contains(&quot;.&quot;) || request.getPath().contains(&quot;:&quot;)) 
+                //these look like component event requests, which we didn't rewrite, so ignore.
+                if (request.getPath().contains(".") || request.getPath().contains(":")) 
                 {
                     return request;
                 }
-                String pageName = request.getPath().substring(1,request.getPath().indexOf(&#39;/&#39;,1));
-                return new SimpleRequestWrapper(request, request.getPath().replaceAll(pageName,pageName + &quot;page&quot;));
+                String pageName = request.getPath().substring(1,request.getPath().indexOf('/',1));
+                return new SimpleRequestWrapper(request, request.getPath().replaceAll(pageName,pageName + "page"));
             }
             else
             {
@@ -248,7 +256,7 @@ public static void contributeURLRewriter
                {
                     String path = request.getPath();
                     String pageName = context.getPageParameters().getLogicalPageName().toLowerCase();
-                    String newPageName = pageName.replaceAll(&quot;page$&quot;,&quot;&quot;);
+                    String newPageName = pageName.replaceAll("page$","");
                     return new SimpleRequestWrapper(request,path.replaceAll(pageName,newPageName));
                }
             }
@@ -261,10 +269,10 @@ public static void contributeURLRewriter
         }
     };
 
-    configuration.add(&quot;rule1&quot;,rule);
+    configuration.add("rule1",rule);
 
 }
-]]></script>
+</pre>
 </div></div>
 
 <p>In the first part of <code>process</code>, <code>context.isIncoming()</code> determines if the call to <code>process</code> occurred due to an inbound request. If so, the rule reverses the mapping done in the second portion of the method, so tapestry sees the original request.</p>