You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2015/07/15 21:47:28 UTC
svn commit: r958463 - in /websites/production/cxf/content:
cache/docs.pageCache docs/jax-rs-data-bindings.html
Author: buildbot
Date: Wed Jul 15 19:47:28 2015
New Revision: 958463
Log:
Production update by buildbot for cxf
Modified:
websites/production/cxf/content/cache/docs.pageCache
websites/production/cxf/content/docs/jax-rs-data-bindings.html
Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/cxf/content/docs/jax-rs-data-bindings.html
==============================================================================
--- websites/production/cxf/content/docs/jax-rs-data-bindings.html (original)
+++ websites/production/cxf/content/docs/jax-rs-data-bindings.html Wed Jul 15 19:47:28 2015
@@ -118,11 +118,11 @@ Apache CXF -- JAX-RS Data Bindings
<!-- Content -->
<div class="wiki-content">
<div id="ConfluenceContent"><p> </p><p> </p><p> </p><p> <span class="inline-first-p" style="font-size:2em;font-weight:bold">JAX-RS : Data Bindings</span> </p><p> </p><p> </p><p> </p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1435780143813 {padding: 0px;}
-div.rbtoc1435780143813 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1435780143813 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1436989616470 {padding: 0px;}
+div.rbtoc1436989616470 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1436989616470 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1435780143813">
+/*]]>*/</style></p><div class="toc-macro rbtoc1436989616470">
<ul class="toc-indentation"><li><a shape="rect" href="#JAX-RSDataBindings-JAXBsupport">JAXB support</a>
<ul class="toc-indentation"><li><a shape="rect" href="#JAX-RSDataBindings-ConfiguringJAXBprovider">Configuring JAXB provider</a></li><li><a shape="rect" href="#JAX-RSDataBindings-JAXBandMoxy">JAXB and Moxy</a></li></ul>
</li><li><a shape="rect" href="#JAX-RSDataBindings-JSONsupport">JSON support</a>
@@ -250,7 +250,7 @@ public class CustomerService {
</util:map>
/<beans>
</pre>
-</div></div><p><strong>Note</strong> that starting from CXF 2.3.0 it may not be needed to set up a custom namespace map on the write side with JSONProvider making a 'best' effort to retrieve them during the JAXB Marshaller calls. Starting from CXF 2.6.1 and 2.5.4 setting the namespace maps will additionally configure a Marshaller namespace mapper.</p><p>Schema validation can be enabled and custom @Consume and @Produce media types can be injected, see <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml">this example</a> and "Customizing media types for message body providers" and "Schema Validation" sections for more information.</p><h3 id="JAX-RSDataBindings-DealingwithJettisonarrayserializationissues">Dealing with Jettison array serialization issues</h3><p>By default, Jettison wrongly serializes List objects containing a single value only. To work around this issue, one needs to enable a 'se
rializeAsArray' feature on a JSONProvider, with the additional option of specifying the individual fields which needs to be processed accordingly using an 'arrayKeys' property. Please see <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml">this example</a> for more information.</p><p>Note that 'serializeAsArray' and 'arrayKeys' can be combined to produce so called natural convention sequences. For example, given the following two class definitions :</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p><strong>Note</strong> that starting from CXF 2.3.0 it may not be needed to set up a custom namespace map on the write side with JSONProvider making a 'best' effort to retrieve them during the JAXB Marshaller calls. Starting from CXF 2.6.1 and 2.5.4 setting the namespace maps will additionally configure a Marshaller namespace mapper.</p><p>Schema validation can be enabled and custom @Consume and @Produce media types can be injected, see <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml">this example</a> and "Customizing media types for message body providers" and "Schema Validation" sections for more information.</p><p><strong>Note</strong> that JSONProvider is Jettison based and supports only JAXB annotated beans. You should use Jackson provider to process POJOs without JAXB annotations.</p><h3 id="JAX-RSDataBindings-DealingwithJettisonarrayserializationissues">Dealing with J
ettison array serialization issues</h3><p>By default, Jettison wrongly serializes List objects containing a single value only. To work around this issue, one needs to enable a 'serializeAsArray' feature on a JSONProvider, with the additional option of specifying the individual fields which needs to be processed accordingly using an 'arrayKeys' property. Please see <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml">this example</a> for more information.</p><p>Note that 'serializeAsArray' and 'arrayKeys' can be combined to produce so called natural convention sequences. For example, given the following two class definitions :</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;">@XmlRootElement()
@XmlType(name = "", propOrder = {"title", "comments" })
public static class Post {