当前位置: 代码迷 >> JavaScript >> SSH+ExtJS框架中Action去Extjs传参
  详细解决方案

SSH+ExtJS框架中Action去Extjs传参

热度:104   发布时间:2012-11-01 11:11:32.0
SSH+ExtJS框架中Action往Extjs传参
我在Action中定义了一个字符串
private String example;
set get方法省略
public String decision(){
this.example = "example";
return SUCCESS;
}
struts.xml中的配置
<action name="feeding_*" class="feedingRatesAction" method="{1}">
<result type="json" />
</action>
JS:
decisionForm.form.submit({
        url : 'feeding_decision.action',
        success : function(from, action) {
         Ext.Msg.alert('', '提交成功!');
                  Ext.Msg.alert('', '提交成功!');//在这个位置显示example的值
        },
        failure : function(form, action) {
         Ext.Msg.alert('', '提交失败!');
        },
        waitMsg : '正在提交数据,稍后...'
       });


我在页面中的Ext.Msg.alert()中想取到Action中的example的值:
success : function(form, action) {
    Ext.Msg.alert('value', action.result.example);
}
  相关解决方案