I want to use Jersey for implemnting some Java REST services. The default POJO converter JAXB handles JSON objects a bit strange, so I want to use Jackson for converting POJOs with little or less overhead. How would do I tell the J2ME framework to use another converter?
My web.xml looks like this:
<!-- Jersey JAVA REST implementation -->
<servlet>
<servlet-name>Jersey</servlet-name>
<servlet-class>
com.sun.jersey.spi.container.servlet.ServletContainer
</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>org.foobar.rest.services</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…