开发者

Weird Namespace Being Added by XStream in Spring MVC Controller Response

Does anyone know why I am getting a namespace on an XML node for the property "object"?

It should just be开发者_StackOverflow中文版 <object>JeffF Cross</object>. The property in debug mode looks like fine and doesn't contain any extra data and is a string. This is in Spring MVC using a Xstream as a serializer.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><getMemberActivitiesResponse><validator/><activities><list>

<object xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">JeffF Cross</object>

<validator/><actor>MichaelL FlynnN</actor><actorId>1</actorId><context>Cisco Blogs</context><contextId>1</contextId><dateCreated>3/24/2011 12:00 AM</dateCreated><id>1</id><imageId>9401</imageId><imagePath>http://localhost:8080/Web/resources/assets/users/default.jpgk</imagePath><objectId>54</objectId><verb>is following</verb><verbId>1</verbId></list><total>1</total></activities></getMemberActivitiesResponse>


I fixed this by renaming the property "object" to "directobject". Seems "object" is a keyword that XStream can't parse correctly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜