cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r867253 [22/46] - in /websites/production/cxf/content: ./ 2008/04/28/ 2008/06/20/ 2009/02/10/ 2009/08/04/ cache/ docs/ docs/cxf-architecture.thumbs/ docs/cxf-dependency-graphs.thumbs/ docs/logbrowser-configuration.thumbs/ docs/logbrowser-so...
Date Mon, 24 Jun 2013 17:10:57 GMT
Modified: websites/production/cxf/content/docs/jax-rs-failover.html
==============================================================================
--- websites/production/cxf/content/docs/jax-rs-failover.html (original)
+++ websites/production/cxf/content/docs/jax-rs-failover.html Mon Jun 24 17:10:51 2013
@@ -25,6 +25,18 @@
 <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
 <meta name="keywords" content="business integration, EAI, SOA, Service Oriented Architecture, web services, SOAP, JBI, JMS, WSDL, XML, EDI, Electronic Data Interchange, standards support, integration standards, application integration, middleware, software, solutions, services, CXF, open source">
 <meta name="description" content="Apache CXF, Services Framework - JAX-RS Failover">
+
+  <link href='http://cxf.apache.org/resources/highlighter/styles/shCore.css' rel='stylesheet' type='text/css' />
+  <link href='http://cxf.apache.org/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+  
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
+ 
     <title>
 Apache CXF -- JAX-RS Failover
     </title>
@@ -42,19 +54,15 @@ Apache CXF -- JAX-RS Failover
     <td id="cell-1-0">&nbsp;</td>
     <td id="cell-1-1">&nbsp;</td>
     <td id="cell-1-2">
-      <div style="padding: 5px;">
-        <div id="banner">
-          <!-- Banner -->
-<div id="banner-content">
+      <!-- Banner -->
+<div class="banner" id="banner"><p>
 <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left" colspan="1" nowrap>
 <a shape="rect" href="http://cxf.apache.org/" title="Apache CXF"><span style="font-weight: bold; font-size: 170%; color: white">Apache CXF</span></a>
 </td><td align="right" colspan="1" nowrap>
 <a shape="rect" href="http://www.apache.org/" title="The Apache Sofware Foundation"><img border="0" alt="ASF Logo" src="http://cxf.apache.org/images/asf-logo.png"></a>
 </td></tr></table>
-</div>
-          <!-- Banner -->
-        </div>
-      </div>
+</p></div>
+      <!-- Banner -->
       <div id="top-menu">
         <table border="0" cellpadding="1" cellspacing="0" width="100%">
           <tr>
@@ -94,7 +102,7 @@ Apache CXF -- JAX-RS Failover
 
 
 <hr>
-<ul class="alternate" type="square"><li>Search
+<ul class="alternate" type="square"><li>Search<br clear="none">
 
 <form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
   <div>
@@ -139,81 +147,81 @@ alternate addresses from locators and ot
 <h2><a shape="rect" name="JAX-RSFailover-Spring"></a>Spring </h2>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
 
-&lt;beans xmlns=<span class="code-quote">"http://www.springframework.org/schema/beans"</span>
-       <span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span>
-       <span class="code-keyword">xmlns:jaxrs</span>=<span class="code-quote">"http://cxf.apache.org/jaxrs"</span>
-       <span class="code-keyword">xmlns:util</span>=<span class="code-quote">"http://www.springframework.org/schema/util"</span>
+&lt;beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:jaxrs="http://cxf.apache.org/jaxrs"
+       xmlns:util="http://www.springframework.org/schema/util"
        xsi:schemaLocation="
 http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
 http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"&gt;
-    <span class="code-tag">&lt;bean class=<span class="code-quote">"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"</span>/&gt;</span>
+    &lt;bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/&gt;
     
-    <span class="code-tag">&lt;util:list id=<span class="code-quote">"addressList"</span>&gt;</span>
-        <span class="code-tag">&lt;value&gt;</span>http://localhost:${testutil.ports.Server.1}/rest<span class="code-tag">&lt;/value&gt;</span>
-        <span class="code-tag">&lt;value&gt;</span>http://localhost:${testutil.ports.Server.2}/rest<span class="code-tag">&lt;/value&gt;</span>
-        <span class="code-tag">&lt;value&gt;</span>http://localhost:${testutil.ports.Server.3}/rest<span class="code-tag">&lt;/value&gt;</span>
-    <span class="code-tag">&lt;/util:list&gt;</span>
-
-    <span class="code-tag">&lt;bean id=<span class="code-quote">"SequentialAddresses"</span> class=<span class="code-quote">"org.apache.cxf.clustering.SequentialStrategy"</span>&gt;</span>
-        <span class="code-tag">&lt;property name=<span class="code-quote">"alternateAddresses"</span>&gt;</span>
-            <span class="code-tag">&lt;ref bean=<span class="code-quote">"addressList"</span>/&gt;</span>
-        <span class="code-tag">&lt;/property&gt;</span>
-    <span class="code-tag">&lt;/bean&gt;</span>
-
-    <span class="code-tag">&lt;bean id=<span class="code-quote">"RandomAddresses"</span> class=<span class="code-quote">"org.apache.cxf.clustering.RandomStrategy"</span>&gt;</span>
-        <span class="code-tag">&lt;property name=<span class="code-quote">"alternateAddresses"</span>&gt;</span>
-            <span class="code-tag">&lt;ref bean=<span class="code-quote">"addressList"</span>/&gt;</span>
-        <span class="code-tag">&lt;/property&gt;</span>
-    <span class="code-tag">&lt;/bean&gt;</span>
-
-    <span class="code-tag">&lt;bean id=<span class="code-quote">"failover1"</span> class=<span class="code-quote">"org.apache.cxf.jaxrs.features.clustering.FailoverFeature"</span>&gt;</span>
-        <span class="code-tag">&lt;property name=<span class="code-quote">"strategy"</span> ref=<span class="code-quote">"SequentialAddresses"</span>/&gt;</span>
-    <span class="code-tag">&lt;/bean&gt;</span>
-
-    <span class="code-tag">&lt;bean id=<span class="code-quote">"failover2"</span> class=<span class="code-quote">"org.apache.cxf.jaxrs.features.clustering.FailoverFeature"</span>&gt;</span>
-        <span class="code-tag">&lt;property name=<span class="code-quote">"strategy"</span> ref=<span class="code-quote">"RandomAddresses"</span>/&gt;</span>
-    <span class="code-tag">&lt;/bean&gt;</span>
-
-    <span class="code-tag">&lt;jaxrs:client id=<span class="code-quote">"failoverSequential"</span> address=<span class="code-quote">"http://localhost:8080/initialAddress"</span>&gt;</span>
-       <span class="code-tag">&lt;jaxrs:features&gt;</span>
-           <span class="code-tag">&lt;ref bean=<span class="code-quote">"failover1"</span>/&gt;</span>
-       <span class="code-tag">&lt;/jaxrs:features&gt;</span>
-    <span class="code-tag">&lt;/jaxrs:client&gt;</span>
-
-    <span class="code-tag">&lt;jaxrs:client id=<span class="code-quote">"failoverRandom"</span> address=<span class="code-quote">"http://localhost:8080/initialAddress"</span>&gt;</span>
-       <span class="code-tag">&lt;jaxrs:features&gt;</span>
-           <span class="code-tag">&lt;ref bean=<span class="code-quote">"failover2"</span>/&gt;</span>
-       <span class="code-tag">&lt;/jaxrs:features&gt;</span>
-    <span class="code-tag">&lt;/jaxrs:client&gt;</span>
-
-    &lt;bean id=<span class="code-quote">"myWebClient"</span> class=<span class="code-quote">"org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean"</span> 
-factory-method=<span class="code-quote">"createWebClient"</span>&gt; 
-        <span class="code-tag">&lt;property name=<span class="code-quote">"address"</span> value=<span class="code-quote">"http://some.base.url.that.responds/"</span> /&gt;</span> 
-        <span class="code-tag">&lt;property name=<span class="code-quote">"features"</span>&gt;</span>
-            <span class="code-tag">&lt;ref bean=<span class="code-quote">"failover1"</span>/&gt;</span> 
-        <span class="code-tag">&lt;/property&gt;</span>  
-    <span class="code-tag">&lt;/bean&gt;</span> 
-<span class="code-tag">&lt;/beans&gt;</span>
-</pre>
+    &lt;util:list id="addressList"&gt;
+        &lt;value&gt;http://localhost:${testutil.ports.Server.1}/rest&lt;/value&gt;
+        &lt;value&gt;http://localhost:${testutil.ports.Server.2}/rest&lt;/value&gt;
+        &lt;value&gt;http://localhost:${testutil.ports.Server.3}/rest&lt;/value&gt;
+    &lt;/util:list&gt;
+
+    &lt;bean id="SequentialAddresses" class="org.apache.cxf.clustering.SequentialStrategy"&gt;
+        &lt;property name="alternateAddresses"&gt;
+            &lt;ref bean="addressList"/&gt;
+        &lt;/property&gt;
+    &lt;/bean&gt;
+
+    &lt;bean id="RandomAddresses" class="org.apache.cxf.clustering.RandomStrategy"&gt;
+        &lt;property name="alternateAddresses"&gt;
+            &lt;ref bean="addressList"/&gt;
+        &lt;/property&gt;
+    &lt;/bean&gt;
+
+    &lt;bean id="failover1" class="org.apache.cxf.jaxrs.features.clustering.FailoverFeature"&gt;
+        &lt;property name="strategy" ref="SequentialAddresses"/&gt;
+    &lt;/bean&gt;
+
+    &lt;bean id="failover2" class="org.apache.cxf.jaxrs.features.clustering.FailoverFeature"&gt;
+        &lt;property name="strategy" ref="RandomAddresses"/&gt;
+    &lt;/bean&gt;
+
+    &lt;jaxrs:client id="failoverSequential" address="http://localhost:8080/initialAddress"&gt;
+       &lt;jaxrs:features&gt;
+           &lt;ref bean="failover1"/&gt;
+       &lt;/jaxrs:features&gt;
+    &lt;/jaxrs:client&gt;
+
+    &lt;jaxrs:client id="failoverRandom" address="http://localhost:8080/initialAddress"&gt;
+       &lt;jaxrs:features&gt;
+           &lt;ref bean="failover2"/&gt;
+       &lt;/jaxrs:features&gt;
+    &lt;/jaxrs:client&gt;
+
+    &lt;bean id="myWebClient" class="org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean" 
+factory-method="createWebClient"&gt; 
+        &lt;property name="address" value="http://some.base.url.that.responds/" /&gt; 
+        &lt;property name="features"&gt;
+            &lt;ref bean="failover1"/&gt; 
+        &lt;/property&gt;  
+    &lt;/bean&gt; 
+&lt;/beans&gt;
+]]></script>
 </div></div>
 
 <p>Note that failover feature for jaxrs:client gets configured nearly exactly the same way as it's done for JAX-WS clients. The difference at this stage is that feature class name (org.apache.cxf.jaxrs.features.clustering.FailoverFeature) and a 'strategy' property are 'hidden' for JAX-WS clients due to the use of Spring handlers, example:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-&lt;jaxws:client name=<span class="code-quote">"{http://cxf.apache.org/greeter_control}ReplicatedPortA"</span>
-                  createdFromAPI=<span class="code-quote">"true"</span>&gt;
-        <span class="code-tag">&lt;jaxws:features&gt;</span>
-            <span class="code-tag">&lt;clustering:failover&gt;</span>
-                <span class="code-tag">&lt;clustering:strategy&gt;</span>
-                    <span class="code-tag">&lt;ref bean=<span class="code-quote">"SequentialAddresses"</span>/&gt;</span>
-                <span class="code-tag">&lt;/clustering:strategy&gt;</span>
-            <span class="code-tag">&lt;/clustering:failover&gt;</span>
-        <span class="code-tag">&lt;/jaxws:features&gt;</span>
-    <span class="code-tag">&lt;/jaxws:client&gt;</span>
-</pre>
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;jaxws:client name="{http://cxf.apache.org/greeter_control}ReplicatedPortA"
+                  createdFromAPI="true"&gt;
+        &lt;jaxws:features&gt;
+            &lt;clustering:failover&gt;
+                &lt;clustering:strategy&gt;
+                    &lt;ref bean="SequentialAddresses"/&gt;
+                &lt;/clustering:strategy&gt;
+            &lt;/clustering:failover&gt;
+        &lt;/jaxws:features&gt;
+    &lt;/jaxws:client&gt;
+]]></script>
 </div></div>  
 
 <p>In other words, JAX-RS clients can not use clustering:failover/clustering:strategy only at this stage, the rest is the same. An effort will be undertaken to make sure this configuration becomes identical for JAX-WS and JAX-RS clients. </p>
@@ -221,29 +229,29 @@ factory-method=<span class="code-quote">
 <h2><a shape="rect" name="JAX-RSFailover-Code"></a>Code</h2>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 org.apache.cxf.jaxrs.features.clustering.FailoverFeature feature = 
-    <span class="code-keyword">new</span> org.apache.cxf.jaxrs.features.clustering.FailoverFeature();
-List&lt;<span class="code-object">String</span>&gt; alternateAddresses = <span class="code-keyword">new</span> ArrayList&lt;<span class="code-object">String</span>&gt;();
-<span class="code-comment">// addresses are alternate addresses provided at start-up
-</span><span class="code-keyword">for</span> (<span class="code-object">String</span> s : address) {
+    new org.apache.cxf.jaxrs.features.clustering.FailoverFeature();
+List&lt;String&gt; alternateAddresses = new ArrayList&lt;String&gt;();
+// addresses are alternate addresses provided at start-up
+for (String s : address) {
     alternateAddresses.add(s);
 }
-SequentialStrategy strategy = <span class="code-keyword">new</span> SequentialStrategy();
+SequentialStrategy strategy = new SequentialStrategy();
 strategy.setAlternateAddresses(alternateAddresses);
 feature.setStrategy(strategy);
 
-JAXRSClientFactoryBean bean = <span class="code-keyword">new</span> JAXRSClientFactoryBean();
-bean.setAddress(<span class="code-quote">"http:<span class="code-comment">//localhost:8080/inactive-replica"</span>);
-</span>List&lt;AbstractFeature&gt; features = <span class="code-keyword">new</span> ArrayList&lt;AbstractFeature&gt;();
+JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
+bean.setAddress("http://localhost:8080/inactive-replica");
+List&lt;AbstractFeature&gt; features = new ArrayList&lt;AbstractFeature&gt;();
 features.add(feature);
 bean.setFeatures(features);
 
-<span class="code-comment">// create proxy:
-</span>bean.create(BookStore.class);
-<span class="code-comment">// create web client
-</span>bean.createWebClient();
-</pre>
+// create proxy:
+bean.create(BookStore.class);
+// create web client
+bean.createWebClient();
+]]></script>
 </div></div>
 
 <h1><a shape="rect" name="JAX-RSFailover-LoadDistribution"></a>Load Distribution </h1>
@@ -251,49 +259,49 @@ bean.setFeatures(features);
 <p>CXF Load Distribution feature is a failover feature which can iterate where alternate addresses not only in case of failures but also after a successful invocation has been done.<br clear="none">
 It is configured for CXF JAX-RS clients exactly the same way Failover feature is, the only difference is that a (conduit) selector property is also specified, example:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-&lt;beans xmlns=<span class="code-quote">"http://www.springframework.org/schema/beans"</span>
-       <span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span>
-       <span class="code-keyword">xmlns:jaxrs</span>=<span class="code-quote">"http://cxf.apache.org/jaxrs"</span>
-       <span class="code-keyword">xmlns:util</span>=<span class="code-quote">"http://www.springframework.org/schema/util"</span>
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:jaxrs="http://cxf.apache.org/jaxrs"
+       xmlns:util="http://www.springframework.org/schema/util"
        xsi:schemaLocation="
 http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
 http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"&gt;
-    <span class="code-tag">&lt;bean class=<span class="code-quote">"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"</span>/&gt;</span>
+    &lt;bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/&gt;
     
-    <span class="code-tag">&lt;util:list id=<span class="code-quote">"addressList"</span>&gt;</span>
-        <span class="code-tag">&lt;value&gt;</span>http://localhost:${testutil.ports.Server.1}/rest<span class="code-tag">&lt;/value&gt;</span>
-        <span class="code-tag">&lt;value&gt;</span>http://localhost:${testutil.ports.Server.2}/rest<span class="code-tag">&lt;/value&gt;</span>
-        <span class="code-tag">&lt;value&gt;</span>http://localhost:${testutil.ports.Server.3}/rest<span class="code-tag">&lt;/value&gt;</span>
-    <span class="code-tag">&lt;/util:list&gt;</span>
-
-    <span class="code-tag">&lt;bean id=<span class="code-quote">"SequentialAddresses"</span> class=<span class="code-quote">"org.apache.cxf.clustering.SequentialStrategy"</span>&gt;</span>
-        <span class="code-tag">&lt;property name=<span class="code-quote">"alternateAddresses"</span>&gt;</span>
-            <span class="code-tag">&lt;ref bean=<span class="code-quote">"addressList"</span>/&gt;</span>
-        <span class="code-tag">&lt;/property&gt;</span>
-    <span class="code-tag">&lt;/bean&gt;</span>
-
-    <span class="code-tag">&lt;bean id=<span class="code-quote">"targetSelector"</span> class=<span class="code-quote">"org.apache.cxf.clustering.LoadDistributorTargetSelector"</span>/&gt;</span>
-
-    <span class="code-tag">&lt;jaxrs:client id=<span class="code-quote">"loadDistributionSequential"</span> address=<span class="code-quote">"http://localhost:8080/initialAddress"</span>&gt;</span>
-       <span class="code-tag">&lt;jaxrs:features&gt;</span>
-           <span class="code-tag">&lt;bean class=<span class="code-quote">"org.apache.cxf.jaxrs.features.clustering.FailoverFeature"</span>&gt;</span>
-              <span class="code-tag">&lt;property name=<span class="code-quote">"strategy"</span> ref=<span class="code-quote">"SequentialAddresses"</span>/&gt;</span>
-              <span class="code-tag">&lt;property name=<span class="code-quote">"selector"</span> ref=<span class="code-quote">"targetSelector"</span>/&gt;</span>  
-           <span class="code-tag">&lt;/bean&gt;</span>
-       <span class="code-tag">&lt;/jaxrs:features&gt;</span>
-    <span class="code-tag">&lt;/jaxrs:client&gt;</span>
-</pre>
+    &lt;util:list id="addressList"&gt;
+        &lt;value&gt;http://localhost:${testutil.ports.Server.1}/rest&lt;/value&gt;
+        &lt;value&gt;http://localhost:${testutil.ports.Server.2}/rest&lt;/value&gt;
+        &lt;value&gt;http://localhost:${testutil.ports.Server.3}/rest&lt;/value&gt;
+    &lt;/util:list&gt;
+
+    &lt;bean id="SequentialAddresses" class="org.apache.cxf.clustering.SequentialStrategy"&gt;
+        &lt;property name="alternateAddresses"&gt;
+            &lt;ref bean="addressList"/&gt;
+        &lt;/property&gt;
+    &lt;/bean&gt;
+
+    &lt;bean id="targetSelector" class="org.apache.cxf.clustering.LoadDistributorTargetSelector"/&gt;
+
+    &lt;jaxrs:client id="loadDistributionSequential" address="http://localhost:8080/initialAddress"&gt;
+       &lt;jaxrs:features&gt;
+           &lt;bean class="org.apache.cxf.jaxrs.features.clustering.FailoverFeature"&gt;
+              &lt;property name="strategy" ref="SequentialAddresses"/&gt;
+              &lt;property name="selector" ref="targetSelector"/&gt;  
+           &lt;/bean&gt;
+       &lt;/jaxrs:features&gt;
+    &lt;/jaxrs:client&gt;
+]]></script>
 </div></div> 
 
 <p>the selector can be set from code like this:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 org.apache.cxf.jaxrs.features.clustering.FailoverFeature feature = 
-    <span class="code-keyword">new</span> org.apache.cxf.jaxrs.features.clustering.FailoverFeature();
-feature.setSelector(<span class="code-keyword">new</span> org.apache.cxf.clustering.LoadDistributorTargetSelector());
-</pre>
+    new org.apache.cxf.jaxrs.features.clustering.FailoverFeature();
+feature.setSelector(new org.apache.cxf.clustering.LoadDistributorTargetSelector());
+]]></script>
 </div></div> </div>
            </div>
            <!-- Content -->

Modified: websites/production/cxf/content/docs/jax-rs-filters.html
==============================================================================
--- websites/production/cxf/content/docs/jax-rs-filters.html (original)
+++ websites/production/cxf/content/docs/jax-rs-filters.html Mon Jun 24 17:10:51 2013
@@ -25,6 +25,18 @@
 <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
 <meta name="keywords" content="business integration, EAI, SOA, Service Oriented Architecture, web services, SOAP, JBI, JMS, WSDL, XML, EDI, Electronic Data Interchange, standards support, integration standards, application integration, middleware, software, solutions, services, CXF, open source">
 <meta name="description" content="Apache CXF, Services Framework - JAX-RS Filters">
+
+  <link href='http://cxf.apache.org/resources/highlighter/styles/shCore.css' rel='stylesheet' type='text/css' />
+  <link href='http://cxf.apache.org/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+  
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
+ 
     <title>
 Apache CXF -- JAX-RS Filters
     </title>
@@ -42,19 +54,15 @@ Apache CXF -- JAX-RS Filters
     <td id="cell-1-0">&nbsp;</td>
     <td id="cell-1-1">&nbsp;</td>
     <td id="cell-1-2">
-      <div style="padding: 5px;">
-        <div id="banner">
-          <!-- Banner -->
-<div id="banner-content">
+      <!-- Banner -->
+<div class="banner" id="banner"><p>
 <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left" colspan="1" nowrap>
 <a shape="rect" href="http://cxf.apache.org/" title="Apache CXF"><span style="font-weight: bold; font-size: 170%; color: white">Apache CXF</span></a>
 </td><td align="right" colspan="1" nowrap>
 <a shape="rect" href="http://www.apache.org/" title="The Apache Sofware Foundation"><img border="0" alt="ASF Logo" src="http://cxf.apache.org/images/asf-logo.png"></a>
 </td></tr></table>
-</div>
-          <!-- Banner -->
-        </div>
-      </div>
+</p></div>
+      <!-- Banner -->
       <div id="top-menu">
         <table border="0" cellpadding="1" cellspacing="0" width="100%">
           <tr>
@@ -94,7 +102,7 @@ Apache CXF -- JAX-RS Filters
 
 
 <hr>
-<ul class="alternate" type="square"><li>Search
+<ul class="alternate" type="square"><li>Search<br clear="none">
 
 <form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
   <div>
@@ -140,18 +148,18 @@ to write a CXF filter which will introsp
 <p>Here are the interface definitions : </p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">import</span> org.apache.cxf.jaxrs.ext.RequestHandler;
-<span class="code-keyword">import</span> org.apache.cxf.jaxrs.model.ClassResourceInfo;
-<span class="code-keyword">import</span> org.apache.cxf.message.Message;
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+import org.apache.cxf.jaxrs.ext.RequestHandler;
+import org.apache.cxf.jaxrs.model.ClassResourceInfo;
+import org.apache.cxf.message.Message;
 
-<span class="code-keyword">public</span> <span class="code-keyword">interface</span> RequestHandler {
+public interface RequestHandler {
     
     Response handleRequest(Message inputMessage, 
                            ClassResourceInfo resourceClass);
 
 }
-</pre>
+]]></script>
 </div></div>
 
 <p>The request handler implementation can either modify the input Message and let the request to proceed or block the request by returning a non-null Response. </p>
@@ -159,55 +167,55 @@ to write a CXF filter which will introsp
 <p>A response filter implementation can get an access to OperationResourceInfo object representing a method to be invoked on a resource class :</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 OperationResourceInfo ori = exchange.get(OperationResourceInfo.class);
-</pre>
+]]></script>
 </div></div>  
 
 <p>Use OperationResourceInfo in your filter with care. In principle a given request chain may have filters which may want to  overwrite Accept or ContentType message headers which might lead to another method be selected. However if you know no such filters (will) exist in your application then you might want to check an OperationResourceInfo instance as part of your filter logic. </p>
 
 <p>When modifying an input message, one would typically want to replace a message input stream or one of its headers, such as ContentType :</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 InputStream is = message.getContent(InputStream.class);
-message.setContent(<span class="code-keyword">new</span> MyFilterInputStream(is));
-message.put(Message.ACCEPT_CONTENT_TYPE, <span class="code-quote">"custom/media"</span>); 
-</pre>
+message.setContent(new MyFilterInputStream(is));
+message.put(Message.ACCEPT_CONTENT_TYPE, "custom/media"); 
+]]></script>
 </div></div>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">import</span> javax.ws.rs.core.Response;
-<span class="code-keyword">import</span> org.apache.cxf.jaxrs.ext.ResponseHandler;
-<span class="code-keyword">import</span> org.apache.cxf.jaxrs.model.OperationResourceInfo
-<span class="code-keyword">import</span> org.apache.cxf.message.Message;
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+import javax.ws.rs.core.Response;
+import org.apache.cxf.jaxrs.ext.ResponseHandler;
+import org.apache.cxf.jaxrs.model.OperationResourceInfo
+import org.apache.cxf.message.Message;
 
-<span class="code-keyword">public</span> <span class="code-keyword">interface</span> ResponseHandler {
+public interface ResponseHandler {
     
     Response handleResponse(Message outputMessage,
                            OperationResourceInfo invokedOperation, 
                            Response response);
 
 }
-</pre>
+]]></script>
 </div></div>
 
 <p>The response handler implementation can optionally overwrite or modify the application Response or modify the output message. When modifying an output message, one may want to either replace an output stream before message body providers attempt to write to it or replace the actual response object :</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-comment">// replace an output stream
-</span>OutputStream os = message.getContent(OutputStream.class);
-message.setContent(<span class="code-keyword">new</span> MyFilterOutputStream(os));
-
-<span class="code-comment">// replace an actual object
-</span>response.setEntity(<span class="code-keyword">new</span> MyWrapper(response.getEntity()))
-<span class="code-comment">// or using a low-level Message api <span class="code-keyword">if</span> needed
-</span>MessageContentsList objs = MessageContentsList.getContentsList(message);
-<span class="code-keyword">if</span> (objs !== <span class="code-keyword">null</span> &amp;&amp; objs.size() == 1) {
-    <span class="code-object">Object</span> responseObj = objs.remove(0);
-    obj.add(<span class="code-keyword">new</span> MyWrapper(responseObj));
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+// replace an output stream
+OutputStream os = message.getContent(OutputStream.class);
+message.setContent(new MyFilterOutputStream(os));
+
+// replace an actual object
+response.setEntity(new MyWrapper(response.getEntity()))
+// or using a low-level Message api if needed
+MessageContentsList objs = MessageContentsList.getContentsList(message);
+if (objs !== null &amp;&amp; objs.size() == 1) {
+    Object responseObj = objs.remove(0);
+    obj.add(new MyWrapper(responseObj));
 }
-</pre>
+]]></script>
 </div></div>
 
 <p>Please see <a shape="rect" class="external-link" href="http://sberyozkin.blogspot.com/2008/07/rest-and-soap-united-in-cxf.html" rel="nofollow">this blog entry</a> for another example of when response filters can be useful.</p>
@@ -217,23 +225,23 @@ message.setContent(<span class="code-key
 <p>The implementations can be registered like any other types of providers :</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
 
-<span class="code-tag">&lt;beans&gt;</span>
-<span class="code-tag">&lt;jaxrs:server id=<span class="code-quote">"customerService"</span> address=<span class="code-quote">"/"</span>&gt;</span>
-    <span class="code-tag">&lt;jaxrs:serviceBeans&gt;</span>
-      <span class="code-tag">&lt;bean class=<span class="code-quote">"org.CustomerService"</span> /&gt;</span>
-    <span class="code-tag">&lt;/jaxrs:serviceBeans&gt;</span>
-
-    <span class="code-tag">&lt;jaxrs:providers&gt;</span>
-      <span class="code-tag">&lt;ref bean=<span class="code-quote">"authorizationFilter"</span> /&gt;</span>
-    <span class="code-tag">&lt;/jaxrs:providers&gt;</span>
-    <span class="code-tag">&lt;bean id=<span class="code-quote">"authorizationFilter"</span> class=<span class="code-quote">"com.bar.providers.AuthorizationRequestHandler"</span>&gt;</span>
-        <span class="code-tag"><span class="code-comment">&lt;!-- authorization bean properties --&gt;</span></span>
-    <span class="code-tag">&lt;/bean&gt;</span>
-<span class="code-tag">&lt;/jaxrs:server&gt;</span>
-<span class="code-tag">&lt;/beans&gt;</span>
-</pre>
+&lt;beans&gt;
+&lt;jaxrs:server id="customerService" address="/"&gt;
+    &lt;jaxrs:serviceBeans&gt;
+      &lt;bean class="org.CustomerService" /&gt;
+    &lt;/jaxrs:serviceBeans&gt;
+
+    &lt;jaxrs:providers&gt;
+      &lt;ref bean="authorizationFilter" /&gt;
+    &lt;/jaxrs:providers&gt;
+    &lt;bean id="authorizationFilter" class="com.bar.providers.AuthorizationRequestHandler"&gt;
+        &lt;!-- authorization bean properties --&gt;
+    &lt;/bean&gt;
+&lt;/jaxrs:server&gt;
+&lt;/beans&gt;
+]]></script>
 </div></div>
 
 <h2><a shape="rect" name="JAX-RSFilters-DifferencebetweenJAXRSfiltersandCXFinterceptors"></a>Difference between JAXRS filters and CXF interceptors</h2>
@@ -245,31 +253,31 @@ message.setContent(<span class="code-key
 <p>Sometimes you may want to use CXF interceptors rather than writing JAXRS filters. For example, suppose you combine JAXWS and JAXRS and you need to log only inbound or outbound messages. You can reuse the existing CXF interceptors :</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-<span class="code-tag">&lt;beans&gt;</span>
-<span class="code-tag">&lt;bean id=<span class="code-quote">"logInbound"</span> class=<span class="code-quote">"org.apache.cxf.interceptor.LoggingInInterceptor"</span>/&gt;</span>
-<span class="code-tag">&lt;bean id=<span class="code-quote">"logOutbound"</span> class=<span class="code-quote">"org.apache.cxf.interceptor.LoggingOutInterceptor"</span>/&gt;</span>
-
-<span class="code-tag">&lt;jaxrs:server&gt;</span> 
- <span class="code-tag">&lt;jaxrs:inInterceptors&gt;</span>
-     <span class="code-tag">&lt;ref bean=<span class="code-quote">"logInbound"</span>/&gt;</span>
- <span class="code-tag">&lt;/jaxrs:inInterceptors&gt;</span>
- <span class="code-tag">&lt;jaxrs:outInterceptors&gt;</span>
-    <span class="code-tag">&lt;ref bean=<span class="code-quote">"logOutbound"</span>/&gt;</span>
- <span class="code-tag">&lt;/jaxrs:outInterceptors&gt;</span>
-<span class="code-tag">&lt;/jaxrs:server&gt;</span>
-
-<span class="code-tag">&lt;jaxws:endpoint&gt;</span>
- <span class="code-tag">&lt;jaxws:inInterceptors&gt;</span>
-     <span class="code-tag">&lt;ref bean=<span class="code-quote">"logInbound"</span>/&gt;</span>
- <span class="code-tag">&lt;/jaxws:inInterceptors&gt;</span>
- <span class="code-tag">&lt;jaxws:outInterceptors&gt;</span>
-    <span class="code-tag">&lt;ref bean=<span class="code-quote">"logOutbound"</span>/&gt;</span>
- <span class="code-tag">&lt;/jaxws:outInterceptors&gt;</span>
-<span class="code-tag">&lt;/jaxws:endpoint&gt;</span>
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;beans&gt;
+&lt;bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor"/&gt;
+&lt;bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/&gt;
+
+&lt;jaxrs:server&gt; 
+ &lt;jaxrs:inInterceptors&gt;
+     &lt;ref bean="logInbound"/&gt;
+ &lt;/jaxrs:inInterceptors&gt;
+ &lt;jaxrs:outInterceptors&gt;
+    &lt;ref bean="logOutbound"/&gt;
+ &lt;/jaxrs:outInterceptors&gt;
+&lt;/jaxrs:server&gt;
+
+&lt;jaxws:endpoint&gt;
+ &lt;jaxws:inInterceptors&gt;
+     &lt;ref bean="logInbound"/&gt;
+ &lt;/jaxws:inInterceptors&gt;
+ &lt;jaxws:outInterceptors&gt;
+    &lt;ref bean="logOutbound"/&gt;
+ &lt;/jaxws:outInterceptors&gt;
+&lt;/jaxws:endpoint&gt;
 
-<span class="code-tag">&lt;/beans&gt;</span>
-</pre>
+&lt;/beans&gt;
+]]></script>
 </div></div> 
 
 <p>Reusing other CXF interceptors/features such as GZIP handlers can be useful too.</p>
@@ -291,11 +299,11 @@ Message.HTTP_REQUEST_METHOD in a given M
 <p>One can do it either from a CXF input interceptor (registered at the early phase like USER_STREAM) or from a RequestHandler filter, for example :</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-object">String</span> s = m.get(Message.REQUEST_URI);
-s += <span class="code-quote">"/data/"</span>;
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+String s = m.get(Message.REQUEST_URI);
+s += "/data/";
 m.put(Message.REQUEST_URI, s);
-</pre>
+]]></script>
 </div></div> 
 
 <p>If the updated Request URI has a new query string, then you also need to update a Message.QUERY_STRING property.</p>
@@ -308,30 +316,30 @@ m.put(Message.REQUEST_URI, s);
 This can be done either from a CXF output interceptor (phase like MARSHALL will do) or from a ResponseHandler filter, for example this code will work for both JAXRS and JAXWS :</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">import</span> java.util.Map;
-<span class="code-keyword">import</span> java.util.TreeMap;
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+import java.util.Map;
+import java.util.TreeMap;
 
-<span class="code-keyword">import</span> org.apache.cxf.message.Message;
-<span class="code-keyword">import</span> org.apache.cxf.phase.AbstractPhaseInterceptor;
-<span class="code-keyword">import</span> org.apache.cxf.phase.Phase;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
 
 
-<span class="code-keyword">public</span> class CustomOutInterceptor <span class="code-keyword">extends</span> AbstractOutDatabindingInterceptor {
+public class CustomOutInterceptor extends AbstractOutDatabindingInterceptor {
     
-    <span class="code-keyword">public</span> CustomOutInterceptor() {
-        <span class="code-keyword">super</span>(Phase.MARSHAL);
+    public CustomOutInterceptor() {
+        super(Phase.MARSHAL);
     }
 
-    <span class="code-keyword">public</span> void handleMessage(Message outMessage) {
-        Map&lt;<span class="code-object">String</span>, List&lt;<span class="code-object">String</span>&gt;&gt; headers = (Map&lt;<span class="code-object">String</span>, List&lt;<span class="code-object">String</span>&gt;&gt;)outMessage.get(Message.PROTOCOL_HEADERS);
-        <span class="code-keyword">if</span> (headers == <span class="code-keyword">null</span>) {
-            headers = <span class="code-keyword">new</span> TreeMap&lt;<span class="code-object">String</span>, List&lt;<span class="code-object">String</span>&gt;&gt;(<span class="code-object">String</span>.CASE_INSENSITIVE_ORDER);
+    public void handleMessage(Message outMessage) {
+        Map&lt;String, List&lt;String&gt;&gt; headers = (Map&lt;String, List&lt;String&gt;&gt;)outMessage.get(Message.PROTOCOL_HEADERS);
+        if (headers == null) {
+            headers = new TreeMap&lt;String, List&lt;String&gt;&gt;(String.CASE_INSENSITIVE_ORDER);
             message.put(Message.PROTOCOL_HEADERS, headers);
         }
-        <span class="code-comment">// modify headers  
-</span>    }    
-</pre>
+        // modify headers  
+    }    
+]]></script>
 </div></div>  
 
 <p>At the moment it is not possible to override a response status code from a CXF interceptor running before JAXRSOutInterceptor, like CustomOutInterceptor above, which will be fixed.<br clear="none">
@@ -342,9 +350,9 @@ The only option at the moment is to use 
 <p>In some cases you may want to have a JAXRS Response entity which a given RequestHandler or ResponseHandler has produced to be directly written to the output stream. For example, a CXF JAXRS WADLGenerator RequestHandler produces an XML content which does not have to be serialized by JAXRS MessageBodyWriters. If you do need to have the writers ignored then set the following property on the current exchange in the custom handler :</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-message.getExchange().put(<span class="code-quote">"ignore.message.writers"</span>, <span class="code-keyword">true</span>);
-</pre>
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+message.getExchange().put("ignore.message.writers", true);
+]]></script>
 </div></div>
 
 <h1><a shape="rect" name="JAX-RSFilters-Custominvokers"></a>Custom invokers</h1>
@@ -356,17 +364,17 @@ message.getExchange().put(<span class="c
 <p>Custom invokers can be registered like this :</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-<span class="code-tag">&lt;beans&gt;</span>
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;beans&gt;
 
-<span class="code-tag">&lt;jaxrs:server address=<span class="code-quote">"/"</span>&gt;</span> 
- <span class="code-tag">&lt;jaxrs:invoker&gt;</span>
-   <span class="code-tag">&lt;bean class=<span class="code-quote">"org.apache.cxf.systest.jaxrs.CustomJAXRSInvoker"</span>/&gt;</span>
- <span class="code-tag">&lt;/jaxrs:invoker&gt;</span>
-<span class="code-tag">&lt;/jaxrs:server&gt;</span>
+&lt;jaxrs:server address="/"&gt; 
+ &lt;jaxrs:invoker&gt;
+   &lt;bean class="org.apache.cxf.systest.jaxrs.CustomJAXRSInvoker"/&gt;
+ &lt;/jaxrs:invoker&gt;
+&lt;/jaxrs:server&gt;
 
-<span class="code-tag">&lt;/beans&gt;</span>
-</pre>
+&lt;/beans&gt;
+]]></script>
 </div></div> </div>
            </div>
            <!-- Content -->

Modified: websites/production/cxf/content/docs/jax-rs-jsr-311.html
==============================================================================
--- websites/production/cxf/content/docs/jax-rs-jsr-311.html (original)
+++ websites/production/cxf/content/docs/jax-rs-jsr-311.html Mon Jun 24 17:10:51 2013
@@ -25,6 +25,8 @@
 <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
 <meta name="keywords" content="business integration, EAI, SOA, Service Oriented Architecture, web services, SOAP, JBI, JMS, WSDL, XML, EDI, Electronic Data Interchange, standards support, integration standards, application integration, middleware, software, solutions, services, CXF, open source">
 <meta name="description" content="Apache CXF, Services Framework - JAX-RS (JSR-311)">
+
+
     <title>
 Apache CXF -- JAX-RS (JSR-311)
     </title>
@@ -42,19 +44,15 @@ Apache CXF -- JAX-RS (JSR-311)
     <td id="cell-1-0">&nbsp;</td>
     <td id="cell-1-1">&nbsp;</td>
     <td id="cell-1-2">
-      <div style="padding: 5px;">
-        <div id="banner">
-          <!-- Banner -->
-<div id="banner-content">
+      <!-- Banner -->
+<div class="banner" id="banner"><p>
 <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left" colspan="1" nowrap>
 <a shape="rect" href="http://cxf.apache.org/" title="Apache CXF"><span style="font-weight: bold; font-size: 170%; color: white">Apache CXF</span></a>
 </td><td align="right" colspan="1" nowrap>
 <a shape="rect" href="http://www.apache.org/" title="The Apache Sofware Foundation"><img border="0" alt="ASF Logo" src="http://cxf.apache.org/images/asf-logo.png"></a>
 </td></tr></table>
-</div>
-          <!-- Banner -->
-        </div>
-      </div>
+</p></div>
+      <!-- Banner -->
       <div id="top-menu">
         <table border="0" cellpadding="1" cellspacing="0" width="100%">
           <tr>
@@ -94,7 +92,7 @@ Apache CXF -- JAX-RS (JSR-311)
 
 
 <hr>
-<ul class="alternate" type="square"><li>Search
+<ul class="alternate" type="square"><li>Search<br clear="none">
 
 <form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
   <div>

Modified: websites/production/cxf/content/docs/jax-rs-maven-plugins.html
==============================================================================
--- websites/production/cxf/content/docs/jax-rs-maven-plugins.html (original)
+++ websites/production/cxf/content/docs/jax-rs-maven-plugins.html Mon Jun 24 17:10:51 2013
@@ -25,6 +25,18 @@
 <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
 <meta name="keywords" content="business integration, EAI, SOA, Service Oriented Architecture, web services, SOAP, JBI, JMS, WSDL, XML, EDI, Electronic Data Interchange, standards support, integration standards, application integration, middleware, software, solutions, services, CXF, open source">
 <meta name="description" content="Apache CXF, Services Framework - JAX-RS Maven Plugins">
+
+  <link href='http://cxf.apache.org/resources/highlighter/styles/shCore.css' rel='stylesheet' type='text/css' />
+  <link href='http://cxf.apache.org/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+  
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
+ 
     <title>
 Apache CXF -- JAX-RS Maven Plugins
     </title>
@@ -42,19 +54,15 @@ Apache CXF -- JAX-RS Maven Plugins
     <td id="cell-1-0">&nbsp;</td>
     <td id="cell-1-1">&nbsp;</td>
     <td id="cell-1-2">
-      <div style="padding: 5px;">
-        <div id="banner">
-          <!-- Banner -->
-<div id="banner-content">
+      <!-- Banner -->
+<div class="banner" id="banner"><p>
 <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left" colspan="1" nowrap>
 <a shape="rect" href="http://cxf.apache.org/" title="Apache CXF"><span style="font-weight: bold; font-size: 170%; color: white">Apache CXF</span></a>
 </td><td align="right" colspan="1" nowrap>
 <a shape="rect" href="http://www.apache.org/" title="The Apache Sofware Foundation"><img border="0" alt="ASF Logo" src="http://cxf.apache.org/images/asf-logo.png"></a>
 </td></tr></table>
-</div>
-          <!-- Banner -->
-        </div>
-      </div>
+</p></div>
+      <!-- Banner -->
       <div id="top-menu">
         <table border="0" cellpadding="1" cellspacing="0" width="100%">
           <tr>
@@ -94,7 +102,7 @@ Apache CXF -- JAX-RS Maven Plugins
 
 
 <hr>
-<ul class="alternate" type="square"><li>Search
+<ul class="alternate" type="square"><li>Search<br clear="none">
 
 <form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
   <div>
@@ -140,7 +148,7 @@ Apache CXF -- JAX-RS Maven Plugins
 <p>Here is how you can use it from the command line.</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
 ~/work/archetypes$
 
 mvn archetype:generate -Dfilter=org.apache.cxf.archetype:
@@ -178,25 +186,25 @@ package: org.examples.rest
 
 ~/work/archetypes$ tree simple
 simple
-&#9500;&#9472;&#9472; pom.xml
-&#9492;&#9472;&#9472; src
-    &#9500;&#9472;&#9472; main
-    &#9474;&#160;&#160; &#9500;&#9472;&#9472; java
-    &#9474;&#160;&#160; &#9474;&#160;&#160; &#9492;&#9472;&#9472; org
-    &#9474;&#160;&#160; &#9474;&#160;&#160;     &#9492;&#9472;&#9472; examples
-    &#9474;&#160;&#160; &#9474;&#160;&#160;         &#9492;&#9472;&#9472; rest
-    &#9474;&#160;&#160; &#9474;&#160;&#160;             &#9500;&#9472;&#9472; HelloWorld.java
-    &#9474;&#160;&#160; &#9474;&#160;&#160;             &#9492;&#9472;&#9472; JsonBean.java
-    &#9474;&#160;&#160; &#9492;&#9472;&#9472; webapp
-    &#9474;&#160;&#160;     &#9492;&#9472;&#9472; WEB-INF
-    &#9474;&#160;&#160;         &#9500;&#9472;&#9472; beans.xml
-    &#9474;&#160;&#160;         &#9492;&#9472;&#9472; web.xml
-    &#9492;&#9472;&#9472; test
-        &#9492;&#9472;&#9472; java
-            &#9492;&#9472;&#9472; org
-                &#9492;&#9472;&#9472; examples
-                    &#9492;&#9472;&#9472; rest
-                        &#9492;&#9472;&#9472; HelloWorldIT.java
+??? pom.xml
+??? src
+    ??? main
+    ?ÊÊ ??? java
+    ?ÊÊ ?ÊÊ ??? org
+    ?ÊÊ ?ÊÊ     ??? examples
+    ?ÊÊ ?ÊÊ         ??? rest
+    ?ÊÊ ?ÊÊ             ??? HelloWorld.java
+    ?ÊÊ ?ÊÊ             ??? JsonBean.java
+    ?ÊÊ ??? webapp
+    ?ÊÊ     ??? WEB-INF
+    ?ÊÊ         ??? beans.xml
+    ?ÊÊ         ??? web.xml
+    ??? test
+        ??? java
+            ??? org
+                ??? examples
+                    ??? rest
+                        ??? HelloWorldIT.java
 
 
 ~/work/archetypes$ cd simple
@@ -246,7 +254,7 @@ Tests run: 2, Failures: 0, Errors: 0, Sk
 [INFO] BUILD SUCCESS
 [INFO] ------------------------------------------------------------------------
 ~/work/archetypes/simple$
-</pre>
+]]></script>
 </div></div>  
 
 <p>Note that an "org.apache.cxf.archetype:" filter is used to restrict a number of available archetypes and then a jaxrs archetype is selected. After the sample project has been created it is built and the integration tests are run.</p>

Modified: websites/production/cxf/content/docs/jax-rs-multiparts.html
==============================================================================
--- websites/production/cxf/content/docs/jax-rs-multiparts.html (original)
+++ websites/production/cxf/content/docs/jax-rs-multiparts.html Mon Jun 24 17:10:51 2013
@@ -25,6 +25,18 @@
 <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
 <meta name="keywords" content="business integration, EAI, SOA, Service Oriented Architecture, web services, SOAP, JBI, JMS, WSDL, XML, EDI, Electronic Data Interchange, standards support, integration standards, application integration, middleware, software, solutions, services, CXF, open source">
 <meta name="description" content="Apache CXF, Services Framework - JAX-RS Multiparts">
+
+  <link href='http://cxf.apache.org/resources/highlighter/styles/shCore.css' rel='stylesheet' type='text/css' />
+  <link href='http://cxf.apache.org/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+  
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
+ 
     <title>
 Apache CXF -- JAX-RS Multiparts
     </title>
@@ -42,19 +54,15 @@ Apache CXF -- JAX-RS Multiparts
     <td id="cell-1-0">&nbsp;</td>
     <td id="cell-1-1">&nbsp;</td>
     <td id="cell-1-2">
-      <div style="padding: 5px;">
-        <div id="banner">
-          <!-- Banner -->
-<div id="banner-content">
+      <!-- Banner -->
+<div class="banner" id="banner"><p>
 <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left" colspan="1" nowrap>
 <a shape="rect" href="http://cxf.apache.org/" title="Apache CXF"><span style="font-weight: bold; font-size: 170%; color: white">Apache CXF</span></a>
 </td><td align="right" colspan="1" nowrap>
 <a shape="rect" href="http://www.apache.org/" title="The Apache Sofware Foundation"><img border="0" alt="ASF Logo" src="http://cxf.apache.org/images/asf-logo.png"></a>
 </td></tr></table>
-</div>
-          <!-- Banner -->
-        </div>
-      </div>
+</p></div>
+      <!-- Banner -->
       <div id="top-menu">
         <table border="0" cellpadding="1" cellspacing="0" width="100%">
           <tr>
@@ -94,7 +102,7 @@ Apache CXF -- JAX-RS Multiparts
 
 
 <hr>
-<ul class="alternate" type="square"><li>Search
+<ul class="alternate" type="square"><li>Search<br clear="none">
 
 <form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
   <div>
@@ -133,16 +141,16 @@ Apache CXF -- JAX-RS Multiparts
 <p>For example:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 @POST
-@Path(<span class="code-quote">"/books/jaxbjson"</span>)
-@Produces(<span class="code-quote">"text/xml"</span>)
-<span class="code-keyword">public</span> Response addBookJaxbJson(
-        @Multipart(value = <span class="code-quote">"rootPart"</span>, type = <span class="code-quote">"text/xml"</span>) Book2 b1,
-        @Multipart(value = <span class="code-quote">"book2"</span>, type = <span class="code-quote">"application/json"</span>) Book b2) 
-        <span class="code-keyword">throws</span> Exception {
+@Path("/books/jaxbjson")
+@Produces("text/xml")
+public Response addBookJaxbJson(
+        @Multipart(value = "rootPart", type = "text/xml") Book2 b1,
+        @Multipart(value = "book2", type = "application/json") Book b2) 
+        throws Exception {
 }
-</pre>
+]]></script>
 </div></div>
 
 <p>Note that in this example it's expected that the root part named 'rootPart' is a text-xml Book representation, while a part named 'book2' is a Book JSON sequence.</p>
@@ -150,11 +158,11 @@ Apache CXF -- JAX-RS Multiparts
 <p>All attachment parts can be accessed as a list of <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/Attachment.java">Attachment</a> with Attachment making it easy to deal with a given part:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 @POST
-<span class="code-keyword">public</span> void addAttachments(List&lt;Attachment&gt; atts) <span class="code-keyword">throws</span> Exception {
+public void addAttachments(List&lt;Attachment&gt; atts) throws Exception {
 }
-</pre>
+]]></script>
 </div></div>
 
 <p>For example, Attachment class can be used to get to a <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/ContentDisposition.java">Content-Disposition</a> header, when dealing with the form submission of files.</p>
@@ -162,53 +170,53 @@ Apache CXF -- JAX-RS Multiparts
 <p>Similarly, the whole request body can be represented as a <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/MultipartBody.java">MultipartBody</a>:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 @POST
-<span class="code-keyword">public</span> void addAttachments(MultipartBody body) <span class="code-keyword">throws</span> Exception {
+public void addAttachments(MultipartBody body) throws Exception {
 body.getAllAtachments();
 body.getRootAttachment();
 }
-</pre>
+]]></script>
 </div></div>
 
 <p>When handling complex multipart/form-data submissions (such as those containing files) MultipartBody (and Attachment) need to be used directly. In simpler cases, when every form part can be captured by a String, the following code will suffice:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 @POST
-@Consumes(<span class="code-quote">"multipart/form-data"</span>)
-<span class="code-keyword">public</span> void addForm1(@FormParam(<span class="code-quote">"name"</span>) <span class="code-object">String</span> title, @FormParam(<span class="code-quote">"id"</span>) <span class="code-object">Long</span> id) <span class="code-keyword">throws</span> Exception {
+@Consumes("multipart/form-data")
+public void addForm1(@FormParam("name") String title, @FormParam("id") Long id) throws Exception {
 }
 
 @POST
-@Consumes(<span class="code-quote">"multipart/form-data"</span>)
-<span class="code-keyword">public</span> void addForm2(@FormParam("") BookBean book) <span class="code-keyword">throws</span> Exception {
+@Consumes("multipart/form-data")
+public void addForm2(@FormParam("") BookBean book) throws Exception {
 }
 
 @POST
-@Consumes(<span class="code-quote">"multipart/form-data"</span>)
-<span class="code-keyword">public</span> void addForm3(MultivaluedMap&lt;<span class="code-object">String</span>, <span class="code-object">String</span>&gt; formData) <span class="code-keyword">throws</span> Exception {
+@Consumes("multipart/form-data")
+public void addForm3(MultivaluedMap&lt;String, String&gt; formData) throws Exception {
 }
-</pre>
+]]></script>
 </div></div>
 
 <p>When working with either List of Attachments or MultipartBody, one may want to process the individual parts with the help of some custom procedures. Starting from CXF 2.3.0 it is also possible to do the following:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 @POST
-<span class="code-keyword">public</span> void addAttachments(MultipartBody body) <span class="code-keyword">throws</span> Exception {
-    Book book = body.getAttachmentObject(<span class="code-quote">"bookPart"</span>, Book.class);
+public void addAttachments(MultipartBody body) throws Exception {
+    Book book = body.getAttachmentObject("bookPart", Book.class);
 }
 
 @POST
-<span class="code-keyword">public</span> void addAttachments(List&lt;Attachment&gt; attachments) <span class="code-keyword">throws</span> Exception {
-    <span class="code-keyword">for</span> (Attachment attachment : attachments) {
+public void addAttachments(List&lt;Attachment&gt; attachments) throws Exception {
+    for (Attachment attachment : attachments) {
         Book book = attachment.getObject(Book.class);
     }  
 }
 
-</pre>
+]]></script>
 </div></div>
 
 
@@ -223,28 +231,28 @@ body.getRootAttachment();
 <p>When you write the code like this</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 @POST
-@Path(<span class="code-quote">"/books/jaxbjson"</span>)
-@Produces(<span class="code-quote">"text/xml"</span>)
-<span class="code-keyword">public</span> Response addBookJaxbJson(
-        @Multipart(<span class="code-quote">"rootPart"</span>) Book2 b1,
-        @Multipart(<span class="code-quote">"book2"</span>) Book b2)  {}
-</pre>
+@Path("/books/jaxbjson")
+@Produces("text/xml")
+public Response addBookJaxbJson(
+        @Multipart("rootPart") Book2 b1,
+        @Multipart("book2") Book b2)  {}
+]]></script>
 </div></div>
 
 <p>the runtime will return a 400 status if either "rootPart" or "book2" parts can not be found in the multipart payload.<br clear="none">
 Starting from 2.5.1 it is possible to request the runtime to report a null value in case of missing parts:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 @POST
-@Path(<span class="code-quote">"/books/jaxbjson"</span>)
-@Produces(<span class="code-quote">"text/xml"</span>)
-<span class="code-keyword">public</span> Response addBookJaxbJson(
-        @Multipart(<span class="code-quote">"rootPart"</span>) Book2 b1,
-        @Multipart(value = <span class="code-quote">"book2"</span>, required = <span class="code-keyword">false</span>) Book b2) {}
-</pre>
+@Path("/books/jaxbjson")
+@Produces("text/xml")
+public Response addBookJaxbJson(
+        @Multipart("rootPart") Book2 b1,
+        @Multipart(value = "book2", required = false) Book b2) {}
+]]></script>
 </div></div>
 
 <p>The above code requires the "rootPart" part be available and can handle the case where the "book2" part is missing. </p>
@@ -256,20 +264,20 @@ Starting from 2.5.1 it is possible to re
 <p>On the server side it is sufficient to update the @Produces value for a given method:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">public</span> class Resource {
-   <span class="code-keyword">private</span> List&lt;Book&gt; books; 
-   @Produces(<span class="code-quote">"multipart/mixed;type=text/xml"</span>)
-   <span class="code-keyword">public</span> List&lt;Book&gt; getBooksAsMultipart() {
-      <span class="code-keyword">return</span> booksList;
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+public class Resource {
+   private List&lt;Book&gt; books; 
+   @Produces("multipart/mixed;type=text/xml")
+   public List&lt;Book&gt; getBooksAsMultipart() {
+      return booksList;
    }
 
-   @Produces(<span class="code-quote">"multipart/mixed;type=text/xml"</span>)
-   <span class="code-keyword">public</span> Book getBookAsMultipart() {
-      <span class="code-keyword">return</span> booksList;
+   @Produces("multipart/mixed;type=text/xml")
+   public Book getBookAsMultipart() {
+      return booksList;
    }
 }
-</pre>
+]]></script>
 </div></div>
 
 <p>Note that a 'type' parameter of the 'multipart/mixed' media type indicates that all parts in the multiparts response should have a Content-Type header set to 'text/xml' for both getBooksAsMultipart() and getBookAsMultipart() method responses. The getBooksAsMultipart() response will have 3 parts, the first part will have its Content-ID header set to "root.message@cxf.apache.org", the next parts will have '1' and '2' ids. The getBookAsMultipart() response will have a single part only with its Content-ID header set to "root.message@cxf.apache.org".</p>
@@ -277,28 +285,28 @@ Starting from 2.5.1 it is possible to re
 <p>When returning mixed multiparts containing objects of different types, you can either return a Map with the media type string value to Object pairs or MultipartBody:  </p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">public</span> class Resource {
-   <span class="code-keyword">private</span> List&lt;Book&gt; books; 
-   @Produces(<span class="code-quote">"multipart/mixed"</span>)
-   <span class="code-keyword">public</span> Map&lt;<span class="code-object">String</span>, <span class="code-object">Object</span>&gt; getBooks() {
-      Map&lt;<span class="code-object">String</span>, <span class="code-object">Object</span>&gt; map = <span class="code-keyword">new</span> LinkedHashMap&lt;<span class="code-object">String</span>, <span class="code-object">Object</span>&gt;();
-      map.put(<span class="code-quote">"text/xml"</span>, <span class="code-keyword">new</span> JaxbBook());
-      map.put(<span class="code-quote">"application/json"</span>, <span class="code-keyword">new</span> JSONBook());
-      map.put(<span class="code-quote">"application/octet-stream"</span>, imageInputStream);
-      <span class="code-keyword">return</span> map;  
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+public class Resource {
+   private List&lt;Book&gt; books; 
+   @Produces("multipart/mixed")
+   public Map&lt;String, Object&gt; getBooks() {
+      Map&lt;String, Object&gt; map = new LinkedHashMap&lt;String, Object&gt;();
+      map.put("text/xml", new JaxbBook());
+      map.put("application/json", new JSONBook());
+      map.put("application/octet-stream", imageInputStream);
+      return map;  
    } 
 
-   @Produces(<span class="code-quote">"multipart/mixed"</span>)
-   <span class="code-keyword">public</span> MultipartBody getBooks2() {
-      List&lt;Attachment&gt; atts = <span class="code-keyword">new</span> LinkedList&lt;Attachment&gt;();
-      atts.add(<span class="code-keyword">new</span> Attachment(<span class="code-quote">"root"</span>, <span class="code-quote">"application/json"</span>, <span class="code-keyword">new</span> JSONBook()));
-      atts.add(<span class="code-keyword">new</span> Attachment(<span class="code-quote">"image"</span>, <span class="code-quote">"application/octet-stream"</span>, getImageInputStream()));
-      <span class="code-keyword">return</span> <span class="code-keyword">new</span> MultipartBody(atts, <span class="code-keyword">true</span>);  
+   @Produces("multipart/mixed")
+   public MultipartBody getBooks2() {
+      List&lt;Attachment&gt; atts = new LinkedList&lt;Attachment&gt;();
+      atts.add(new Attachment("root", "application/json", new JSONBook()));
+      atts.add(new Attachment("image", "application/octet-stream", getImageInputStream()));
+      return new MultipartBody(atts, true);  
    }
 
 }
-</pre>
+]]></script>
 </div></div>
 
 <p>Similarly to the method returning a list in a previous code fragment, getBooks() will have the response serialized as multiparts, where the first part will have its Content-ID header set to "root.message@cxf.apache.org", the next parts will have ids like '1', '2', etc. </p>
@@ -308,15 +316,15 @@ Starting from 2.5.1 it is possible to re
 <p>You can also control the contentId and the media type of the root attachment by using a Multipart annotation:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">public</span> class Resource {
-   @Produces(<span class="code-quote">"multipart/form-data"</span>)
-   @Multipart(value = <span class="code-quote">"root"</span>, type = <span class="code-quote">"application/octet-stream"</span>) 
-   <span class="code-keyword">public</span> File testGetImageFromForm() {
-      <span class="code-keyword">return</span> getClass().getResource(<span class="code-quote">"image.png"</span>).getFile();
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+public class Resource {
+   @Produces("multipart/form-data")
+   @Multipart(value = "root", type = "application/octet-stream") 
+   public File testGetImageFromForm() {
+      return getClass().getResource("image.png").getFile();
    }
 }
-</pre>
+]]></script>
 </div></div> 
 
 <p>One can also have lists or maps of DataHandler, DataSource, Attachment, byte arrays or InputStreams handled as multiparts. </p>
@@ -324,15 +332,15 @@ Starting from 2.5.1 it is possible to re
 <p>On the client side multiparts can be written the same way. For example:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 
-WebClient client = WebClient.create(<span class="code-quote">"http:<span class="code-comment">//books"</span>);
-</span>client.type(<span class="code-quote">"multipart/mixed"</span>).accept(<span class="code-quote">"multipart/mixed"</span>);
-List&lt;Attachment&gt; atts = <span class="code-keyword">new</span> LinkedList&lt;Attachment&gt;();
-atts.add(<span class="code-keyword">new</span> Attachment(<span class="code-quote">"root"</span>, <span class="code-quote">"application/json"</span>, <span class="code-keyword">new</span> JSONBook()));
-atts.add(<span class="code-keyword">new</span> Attachment(<span class="code-quote">"image"</span>, <span class="code-quote">"application/octet-stream"</span>, getImageInputStream()));
+WebClient client = WebClient.create("http://books");
+client.type("multipart/mixed").accept("multipart/mixed");
+List&lt;Attachment&gt; atts = new LinkedList&lt;Attachment&gt;();
+atts.add(new Attachment("root", "application/json", new JSONBook()));
+atts.add(new Attachment("image", "application/octet-stream", getImageInputStream()));
 List&lt;Attachment&gt; atts = client.postAndGetCollection(atts, Attachment.class);
-</pre>
+]]></script>
 </div></div>
 
 <p>Note a new WebClient.postAndGetCollection which can be used for a type-safe retrieval of collections. A similar WebClient.getCollection has also been added.</p>
@@ -340,14 +348,14 @@ List&lt;Attachment&gt; atts = client.pos
 <p>When using proxies, a Multipart annotation attached to a method parameter can also be used to set the root contentId and media type. Proxies do not support at the moment multiple method parameters annotated with Multipart (as opposed to the server side) but only a single multipart parameter:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">public</span> class Resource {
-    @Produces(<span class="code-quote">"multipart/mixed"</span>)
-    @Consumes(<span class="code-quote">"multipart/form-data"</span>)
-    @Multipart(value = <span class="code-quote">"root"</span>, type = <span class="code-quote">"application/octet-stream"</span>) 
-    <span class="code-keyword">public</span> File postGetFile(@Multipart(value = <span class="code-quote">"root2"</span>, type = <span class="code-quote">"application/octet-stream"</span>) File file) {}
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+public class Resource {
+    @Produces("multipart/mixed")
+    @Consumes("multipart/form-data")
+    @Multipart(value = "root", type = "application/octet-stream") 
+    public File postGetFile(@Multipart(value = "root2", type = "application/octet-stream") File file) {}
 }
-</pre>
+]]></script>
 </div></div>
 
 <p>A method-level Multipart annotation will affect the writing on the server side and the reading on the client side. A parameter-level Multipart annotation will affect writing on the client (proxy) side and reading on the server side. You don't have to use Multipart annotations.</p>
@@ -357,21 +365,21 @@ List&lt;Attachment&gt; atts = client.pos
 <p>At the moment the only way to upload a file is to use a MultipartBody, Attachment or File:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 
-WebClient client = WebClient.create(<span class="code-quote">"http:<span class="code-comment">//books"</span>);t
-</span>client.type(<span class="code-quote">"multipart/form-data"</span>);
-ContentDisposition cd = <span class="code-keyword">new</span> ContentDisposition(<span class="code-quote">"attachment;filename=image.jpg"</span>);
-Attachment att = <span class="code-keyword">new</span> Attachment(<span class="code-quote">"root"</span>, imageInputStream, cd);
-client.post(<span class="code-keyword">new</span> MultipartBody(att));
+WebClient client = WebClient.create("http://books");t
+client.type("multipart/form-data");
+ContentDisposition cd = new ContentDisposition("attachment;filename=image.jpg");
+Attachment att = new Attachment("root", imageInputStream, cd);
+client.post(new MultipartBody(att));
 
-<span class="code-comment">// or just post the attachment <span class="code-keyword">if</span> it's a single part request only
-</span>client.post(att);
+// or just post the attachment if it's a single part request only
+client.post(att);
 
-<span class="code-comment">// or just use a file
-</span>client.post(getClass().getResource(<span class="code-quote">"image.png"</span>).getFile());
+// or just use a file
+client.post(getClass().getResource("image.png").getFile());
 
-</pre>
+]]></script>
 </div></div>
 
 <p>Using File provides a simpler way as the runtime can figure out how to create a ContentDisposition from a File.</p>
@@ -382,19 +390,19 @@ client.post(<span class="code-keyword">n
 <p>One can use the following properties to set up folder, memory threshold and max size (from CXF 2.4.4 and 2.5) values when dealing with large attachments:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-<span class="code-tag">&lt;beans&gt;</span>
-  <span class="code-tag">&lt;jaxrs:server id=<span class="code-quote">"bookstore1"</span>&gt;</span>
-     <span class="code-tag">&lt;jaxrs:properties&gt;</span>
-         <span class="code-tag">&lt;entry key=<span class="code-quote">"attachment-directory"</span> value=<span class="code-quote">"/temp/bookstore1"</span>/&gt;</span>
-         <span class="code-tag"><span class="code-comment">&lt;!-- 200K--&gt;</span></span>
-         <span class="code-tag">&lt;entry key=<span class="code-quote">"attachment-memory-threshold"</span> value=<span class="code-quote">"404800"</span>/&gt;</span>
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;beans&gt;
+  &lt;jaxrs:server id="bookstore1"&gt;
+     &lt;jaxrs:properties&gt;
+         &lt;entry key="attachment-directory" value="/temp/bookstore1"/&gt;
+         &lt;!-- 200K--&gt;
+         &lt;entry key="attachment-memory-threshold" value="404800"/&gt;
          
-         <span class="code-tag">&lt;entry key=<span class="code-quote">"attachment-max-size"</span> value=<span class="code-quote">"404800"</span>/&gt;</span>
-     <span class="code-tag">&lt;/jaxrs:properties&gt;</span>
-  <span class="code-tag">&lt;/jaxrs:server&gt;</span>  
-<span class="code-tag">&lt;/beans&gt;</span>
-</pre>
+         &lt;entry key="attachment-max-size" value="404800"/&gt;
+     &lt;/jaxrs:properties&gt;
+  &lt;/jaxrs:server&gt;  
+&lt;/beans&gt;
+]]></script>
 </div></div>
 
 <p>Note that such properties can be set up on a per-endpoint basis. Alternatively you can set "attachmentDirectory", "attachmentThreshold" and "attachmentMaxSize" properties directly on either org.apache.cxf.jaxrs.provider.MultipartProvider or, when dealing with multipart/form-data payloads, org.apache.cxf.jaxrs.provider.FormEncodingProvider.</p>
@@ -421,24 +429,24 @@ and<br clear="none">
 <p>For example this <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJson">request</a> can be handled by a method with the following signature:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 @POST
-@Path(<span class="code-quote">"/books/jsonform"</span>)
-@Consumes(<span class="code-quote">"multipart/form-data"</span>)
-<span class="code-keyword">public</span> Response addBookJsonFromForm(Book b1)  {...}
-</pre>
+@Path("/books/jsonform")
+@Consumes("multipart/form-data")
+public Response addBookJsonFromForm(Book b1)  {...}
+]]></script>
 </div></div>
 
 <p>Similarly, this <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJsonJaxb">request</a> can be handled by a method with the following signature:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 @POST
-@Path(<span class="code-quote">"/books/jsonjaxbform"</span>)
-@Consumes(<span class="code-quote">"multipart/form-data"</span>)
-<span class="code-keyword">public</span> Response addBookJaxbJsonForm(@Multipart(<span class="code-quote">"jsonPart"</span>) Book b1,
-                                        @Multipart(<span class="code-quote">"jaxbPart"</span>) Book b2) {}
-</pre>
+@Path("/books/jsonjaxbform")
+@Consumes("multipart/form-data")
+public Response addBookJaxbJsonForm(@Multipart("jsonPart") Book b1,
+                                        @Multipart("jaxbPart") Book b2) {}
+]]></script>
 </div></div>
 
 <p>Note that once a request has more than two parts then one needs to start using @Mutipart, the values can refer to either ContentId header or to ContentDisposition/name. Note that at the moment using @Multipart is preferred to using @FormParam unless a plain name/value submission is dealt with. The reason is that @Multipart can also specify an expected media type of the individual part and thus act similarly to a @Consume annotation.</p>
@@ -448,14 +456,14 @@ and<br clear="none">
 <p>Finally, multipart/form-data requests with multiple files (file uploads) can be supported too. For example, this <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJsonFiles">request</a> can be handled by a method with the signature like :</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 @POST
-@Path(<span class="code-quote">"/books/filesform"</span>)
-@Produces(<span class="code-quote">"text/xml"</span>)
-@Consumes(<span class="code-quote">"multipart/form-data"</span>)
-<span class="code-keyword">public</span> Response addBookFilesForm(@Multipart(<span class="code-quote">"owner"</span>) <span class="code-object">String</span> name,
-                                 @Multipart(<span class="code-quote">"files"</span>) List&lt;Book&gt; books) {} 
-</pre>
+@Path("/books/filesform")
+@Produces("text/xml")
+@Consumes("multipart/form-data")
+public Response addBookFilesForm(@Multipart("owner") String name,
+                                 @Multipart("files") List&lt;Book&gt; books) {} 
+]]></script>
 </div></div>
 
 <p>If you need to know the names of the individual file parts embedded in a "files" outer part (such as "book1" and "book2"), then please use List&lt;Attachment&gt; instead. It is currently not possible to use a Multipart annotation to refer to such inner parts but you can easily get the names from the individual Attachment instances representing these inner parts.</p>
@@ -480,26 +488,26 @@ Please see <a shape="rect" class="extern
 <p>One option is to let Struts2 handle URIs matching some specific patterns only, for example:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-<span class="code-tag">&lt;web-app&gt;</span>
-<span class="code-tag">&lt;filter&gt;</span>
-      <span class="code-tag">&lt;filter-name&gt;</span>struts2<span class="code-tag">&lt;/filter-name&gt;</span>
-      <span class="code-tag">&lt;filter-class&gt;</span>
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+&lt;web-app&gt;
+&lt;filter&gt;
+      &lt;filter-name&gt;struts2&lt;/filter-name&gt;
+      &lt;filter-class&gt;
            org.apache.struts2.dispatcher.FilterDispatcher
-       <span class="code-tag">&lt;/filter-class&gt;</span>
-   <span class="code-tag">&lt;/filter&gt;</span>
+       &lt;/filter-class&gt;
+   &lt;/filter&gt;
 
-   <span class="code-tag">&lt;filter-mapping&gt;</span>
-       <span class="code-tag">&lt;filter-name&gt;</span>struts2<span class="code-tag">&lt;/filter-name&gt;</span>
-       <span class="code-tag">&lt;url-pattern&gt;</span>*.action<span class="code-tag">&lt;/url-pattern&gt;</span>
-   <span class="code-tag">&lt;/filter-mapping&gt;</span>
-
-   <span class="code-tag">&lt;filter-mapping&gt;</span>
-       <span class="code-tag">&lt;filter-name&gt;</span>struts2<span class="code-tag">&lt;/filter-name&gt;</span>
-       <span class="code-tag">&lt;url-pattern&gt;</span>*.jsp<span class="code-tag">&lt;/url-pattern&gt;</span>
-   <span class="code-tag">&lt;/filter-mapping&gt;</span>
-<span class="code-tag">&lt;/web-app&gt;</span>
-</pre>
+   &lt;filter-mapping&gt;
+       &lt;filter-name&gt;struts2&lt;/filter-name&gt;
+       &lt;url-pattern&gt;*.action&lt;/url-pattern&gt;
+   &lt;/filter-mapping&gt;
+
+   &lt;filter-mapping&gt;
+       &lt;filter-name&gt;struts2&lt;/filter-name&gt;
+       &lt;url-pattern&gt;*.jsp&lt;/url-pattern&gt;
+   &lt;/filter-mapping&gt;
+&lt;/web-app&gt;
+]]></script>
 </div></div>
 
 <p>Alternatively,disabling a "struts.multipart.parser" property might help.</p></div>



Mime
View raw message