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 2013/07/16 13:48:01 UTC
svn commit: r869682 - in /websites/production/cxf/content:
cache/docs.pageCache docs/jax-rs-data-bindings.html
Author: buildbot
Date: Tue Jul 16 11:48:01 2013
New Revision: 869682
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 Tue Jul 16 11:48:01 2013
@@ -259,8 +259,31 @@ public class CustomerService {
<h2><a shape="rect" name="JAX-RSDataBindings-JAXBandMoxy"></a>JAXB and Moxy</h2>
-<p>For JAXBElementProvider to support <a shape="rect" class="external-link" href="http://www.eclipse.org/eclipselink/moxy.php" rel="nofollow">Moxy</a> a custom Moxy-aware JAX-RS ContextProvider implementation needs to be registered. <br clear="none">
-If Moxy is used to handle beans without JAXB annotations then setting a 'skipJaxbChecks' property on JAXBElementProvider to 'true' will be needed. </p>
+<p>For JAXBElementProvider to support <a shape="rect" class="external-link" href="http://www.eclipse.org/eclipselink/moxy.php" rel="nofollow">Moxy</a> a custom Moxy-aware JAX-RS ContextProvider implementation needs to be registered in jaxrs:providers. For example:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+import javax.xml.bind.JAXBContext;
+import javax.ws.rs.ext.ContextResolver;
+import org.eclipse.persistence.jaxb.JAXBContextFactory;
+
+public class MoxyJaxbContextResolved implements ContextResolver<JAXBContext> {
+
+ org.eclipse.persistence.jaxb.JAXBContextFactory factory = new JAXBContextFactory();
+
+ public JAXBContext getContext(Class<?> cls) {
+ return factory.createContext(cls);
+ }
+
+}
+]]></script>
+</div></div>
+
+<p>Alternatively, add a "jaxb.properties" file with the entry "javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory" to a package where JAXB beans are located. </p>
+
+<p>If Moxy is used to handle beans without JAXB annotations then setting a 'skipJaxbChecks' property on JAXBElementProvider to 'true' will be needed. </p>
+
+<p>Use JAXBElementProvider "namespaceMapperPropertyName" and "xmlPiPropertyName" properties if you need to customize namespace prefixes or add XML processing instructions with Moxy. JSONProvider will also recognize "namespaceMapperPropertyName" in cases when the namespaces are not ignored.</p>
<h1><a shape="rect" name="JAX-RSDataBindings-JSONsupport"></a>JSON support</h1>