Jaxb 의 schema 를 지정합니다. package-info.java
XmlSchema (namespace = "http://kr.or.eclipse4j.service.domain",
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package kr.or.eclipse4j.service.domain
import javax.xml.bind.annotation.XmlSchema;
serviceContext-rest.xml 에 Json Provider 를 지정해 줍니다.
<jaxrs:server id="openApiService" address="/">
<jaxrs:serviceBeans>
<ref bean="categoryRestService" />
</jaxrs:serviceBeans>
<jaxrs:providers>
<bean class="org.apache.cxf.jaxrs.provider.JSONProvider">
<property name="namespaceMap" ref="jsonNamespace" />
</bean>
</jaxrs:providers>
</jaxrs:server>
jsonNamespace 를 지정해줘야 합니다.
xmlns:util="http://www.springframework.org/schema/util"
...
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
...
<util:map id="jsonNamespace" map-class="java.util.Hashtable">
<entry key="http://kr.or.eclipse4j.service.domain"
value="" />
<entry key="http://cxf.apache.org/bindings/xformat" value="cxf" />
</util:map>
를 지정해줘야 합니다.
소스상에는 당연히
@ProduceMime("application/json")
들어가야 겠죠.
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package kr.or.eclipse4j.service.domain
import javax.xml.bind.annotation.XmlSchema;
serviceContext-rest.xml 에 Json Provider 를 지정해 줍니다.
<jaxrs:serviceBeans>
<ref bean="categoryRestService" />
</jaxrs:serviceBeans>
<jaxrs:providers>
<bean class="org.apache.cxf.jaxrs.provider.JSONProvider">
<property name="namespaceMap" ref="jsonNamespace" />
</bean>
</jaxrs:providers>
</jaxrs:server>
jsonNamespace 를 지정해줘야 합니다.
...
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
...
<util:map id="jsonNamespace" map-class="java.util.Hashtable">
<entry key="http://kr.or.eclipse4j.service.domain"
value="" />
<entry key="http://cxf.apache.org/bindings/xformat" value="cxf" />
</util:map>
를 지정해줘야 합니다.
소스상에는 당연히
@ProduceMime("application/json")
들어가야 겠죠.