【发布时间】:2015-04-02 22:46:27
【问题描述】:
我正在开发 extJs 3.2.x
我有一个返回字符串的简单函数。
public Object getRevenueCurrency(....) {
return "USD";
}
我有 Jackson 映射器将响应类型映射到 JSON。
<bean name="jsonView" class="org.springframework.web.servlet.view.json.MappingJacksonJsonView">
<property name="contentType">
<!-- <value>application/json</value> -->
<value>text/html</value>
</property>
</bean>
尝试检索数据如下:
currencyStore = new Ext.data.JsonStore({
id:'currencystore',
url: 'xxxxxxx?action=getcurrency',
root: 'string',
listeners: {load: function(store) {
rev_currency=store.?????;
}
}
});
currencyStore.on('exception',function( store, records, options ){
alert('Exception was called');
},this);
Fiddler 将来自服务器的响应显示为:
{"string": "USD"}
虽然我没有收到服务器或 js 异常,但调用了异常警报。
1.如何提取币值?
2.在上面的异常处理程序中,有什么方法可以提取关于异常的有意义的信息?
【问题讨论】: