[jira] Created: (CXF-2521) Improvment for JAXBElementProvider for setting NamespacePrefixes

View: New views
4 Messages — Rating Filter:   Alert me  

[jira] Created: (CXF-2521) Improvment for JAXBElementProvider for setting NamespacePrefixes

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Improvment for JAXBElementProvider for setting NamespacePrefixes
----------------------------------------------------------------

                 Key: CXF-2521
                 URL: https://issues.apache.org/jira/browse/CXF-2521
             Project: CXF
          Issue Type: Improvement
          Components: JAX-RS
    Affects Versions: 2.2.4
            Reporter: Hasan Hosgel


We had the problem during our development, that we want to set the NamespacePrefixes for the outgoing resources. For Json it working so far good. But unforunately the org.apache.cxf.jaxrs.provider.JAXBElementProvider does not offering something similar for setting the NamespaceMap. We did an extension for the JAXBElementProvider and override the method createMarshaller(...) from the org.apache.cxf.jaxrs.provider.AbstractJAXBProvider and adding a method for setting the NamespaceMap. Our solution is attached.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-2521) Improvment for JAXBElementProvider for setting NamespacePrefixes

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/CXF-2521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hasan Hosgel updated CXF-2521:
------------------------------

    Attachment: JAXBElementProvider.java

adding the example for the extension of JAXBElementProvider

> Improvment for JAXBElementProvider for setting NamespacePrefixes
> ----------------------------------------------------------------
>
>                 Key: CXF-2521
>                 URL: https://issues.apache.org/jira/browse/CXF-2521
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS
>    Affects Versions: 2.2.4
>            Reporter: Hasan Hosgel
>         Attachments: JAXBElementProvider.java
>
>
> We had the problem during our development, that we want to set the NamespacePrefixes for the outgoing resources. For Json it working so far good. But unforunately the org.apache.cxf.jaxrs.provider.JAXBElementProvider does not offering something similar for setting the NamespaceMap. We did an extension for the JAXBElementProvider and override the method createMarshaller(...) from the org.apache.cxf.jaxrs.provider.AbstractJAXBProvider and adding a method for setting the NamespaceMap. Our solution is attached.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2521) Improvment for JAXBElementProvider for setting NamespacePrefixes

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/CXF-2521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773472#action_12773472 ]

Sergey Beryozkin commented on CXF-2521:
---------------------------------------

Overriding createMarshaller is a good soultion but the simple one is just to do :

<bean id="jaxbProvider" class="org.apache.cxf.jaxrs.provider.JAXBElementProvider">
       <property name="marshallerProperties">
           <map>
             <entry>
<key>
<value>com.sun.xml.bind.namespacePrefixMapper</value>
</key>
<ref bean="NamespacePrefixMapper" />
</entry>
</map>
       </property>
 </bean>

> Improvment for JAXBElementProvider for setting NamespacePrefixes
> ----------------------------------------------------------------
>
>                 Key: CXF-2521
>                 URL: https://issues.apache.org/jira/browse/CXF-2521
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS
>    Affects Versions: 2.2.4
>            Reporter: Hasan Hosgel
>         Attachments: JAXBElementProvider.java
>
>
> We had the problem during our development, that we want to set the NamespacePrefixes for the outgoing resources. For Json it working so far good. But unforunately the org.apache.cxf.jaxrs.provider.JAXBElementProvider does not offering something similar for setting the NamespaceMap. We did an extension for the JAXBElementProvider and override the method createMarshaller(...) from the org.apache.cxf.jaxrs.provider.AbstractJAXBProvider and adding a method for setting the NamespaceMap. Our solution is attached.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-2521) Improvment for JAXBElementProvider for setting NamespacePrefixes

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/CXF-2521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin resolved CXF-2521.
-----------------------------------

    Resolution: Won't Fix

A custom mapper can already be set by specifying marshaller properties from Spring

> Improvment for JAXBElementProvider for setting NamespacePrefixes
> ----------------------------------------------------------------
>
>                 Key: CXF-2521
>                 URL: https://issues.apache.org/jira/browse/CXF-2521
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS
>    Affects Versions: 2.2.4
>            Reporter: Hasan Hosgel
>         Attachments: JAXBElementProvider.java
>
>
> We had the problem during our development, that we want to set the NamespacePrefixes for the outgoing resources. For Json it working so far good. But unforunately the org.apache.cxf.jaxrs.provider.JAXBElementProvider does not offering something similar for setting the NamespaceMap. We did an extension for the JAXBElementProvider and override the method createMarshaller(...) from the org.apache.cxf.jaxrs.provider.AbstractJAXBProvider and adding a method for setting the NamespaceMap. Our solution is attached.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.