Springs:创建Restful服务,而不使用@xml标记注释域类

时间:2013-06-20 23:06:30

标签: rest spring-mvc marshalling castor

我需要创造一个宁静的服务。我无法访问某些类,但需要在结果中发送相同的类。有没有办法将对象映射到xml。我尝试使用org.springframework.oxm.castor.CastorMarshaller,但它在xml中提供额外标签的响应,如

<bean-property-binding-result field-error-count="0" global-error-count="0" error-count="0">

有没有办法使用castor marshaller完成它?如果没有,任何人都可以重定向到写页面

1 个答案:

答案 0 :(得分:0)

我通过将速度模板用作xml模板并将该xml作为调用的响应返回来解决了这个问题。