Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-1671

Add a setter to JSONProvider to set the XML Namespace to Jettison prefix map

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1, 2.0.6, 2.1.1, 2.0.7
    • 2.1.2
    • JAX-RS
    • None
    • Novice

    Description

      There is currently no way to configure a REST service to pass an XML namespace to jettison prefix mapping using the default JSONProvider.

      • Move nstojns to a field instead of creating an empty map on each request
      • Add a property setter to set nstojns

      This will allow you to do this in Spring:
      <util:map id="jsonNamespaceMap" map-class="java.util.Hashtable">
      <entry key="http://www.example.com/shakedown" value="e"/>
      <entry key="http://cxf.apache.org/bindings/xformat" value="cxf"/>
      </util:map>

      <bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider">
      <property name="namespaceMap" ref="jsonNamespaceMap"/>
      </bean>

      <jaxrs:server id="jsonRestEndpoint" address="/system">
      <jaxrs:serviceBeans>
      <ref bean="restImpl"/>
      </jaxrs:serviceBeans>
      <jaxrs:entityProviders>
      <ref bean="jsonProvider"/>
      </jaxrs:entityProviders>
      </jaxrs:server>

      Attachments

        1. CXF-1671-trunk.patch
          2 kB
          Joe Sunday

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            jsunday Joe Sunday
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: