Announcement Announcement Module
Collapse
No announcement yet.
Spring 3.1.x - How to Automatically Scan JAXB2 Classes using Annotations for REST Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring 3.1.x - How to Automatically Scan JAXB2 Classes using Annotations for REST

    I am using Spring 3.1.x and CXF 2.6.1 for REST services. I using jaxbXmlProvider as shown below.

    Code:
    <jaxrs:server ...
    <jaxrs:providers>
       <ref bean="jaxbXmlProvider" />
    </jaxrs:providers>
    ...
    </jaxrs:server>
    
    
    <bean id="jaxbXmlProvider" class="org.apache.cxf.jaxrs.provider.JAXBElementProvider">
         <property name="jaxbElementClassNames" ref="elements" /> 
    </bean>
    
    
    <util:list id="elements">
        <value>com.model.City</value>
        <value>com.model.Cities</value>
    </util:list>

    Instead of listing all the POJOs I would like Spring to automatically scan/pick them from a package.
Working...
X