原文出处:http://blog.sina.com.cn/s/blog_4c6e822d0102dvcl.html


    今天从网上看了Struts2返回XML格式 http://xia9527.iteye.com/blog/650212#comments这篇文章,按照作者的写法写了,却没得到想要的结果,很显然不是作者的原因,因为网上给的方法都是这么写的,差不多调了我一个上午的时间,没烦死,最后在console里发现了这个错误

There is no result type defined for type 'plaintext' mapped with name 'xmlMessage'.

上网找了找发现要改成

<action name="outxml" class="com.mobileGPS.action.UserInfoAction" method="outxml">
<result name="xmlMessage" type="plainText"></result>
</action>

注意是struts2.1版本后plaintext改为了plainText了~~~~真叫人无语,不知道为啥struts非要在这种细微末节上改,写下这篇以纪念我悲哀的一上午吧。