在struts.xml中使用result type="json" 怎么在ajax中获得值
在struts.xml中使用result type="json" 如何在ajax中获得值
从来没用过struts配置文件中返回类型是json的
我现在在action中有一个字符串private String errorMsg="错误",如何能在页面ajax中获得这个字符串的值呢?struts配置文件,包括action要怎么写呀?谢谢大神赐教!
------解决思路----------------------
参考下,原理是一样的
http://blog.****.net/jationxiaozi/article/details/6827764/
从来没用过struts配置文件中返回类型是json的
<action name="listProduct" class="createGiftQueryAction" method="listProduct">
<result type="json">
<param name="root">productList</param>
</result>
<result type="json" name="noProduct">
<param name="errMsg">errMsg</param>
</result>
<result type="json" name="noUserId">
<param name="errMsg">errMsg</param>
</result>
</action>
我现在在action中有一个字符串private String errorMsg="错误",如何能在页面ajax中获得这个字符串的值呢?struts配置文件,包括action要怎么写呀?谢谢大神赐教!
------解决思路----------------------
参考下,原理是一样的
http://blog.****.net/jationxiaozi/article/details/6827764/