首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

SSH+ExtJS框架中Action去Extjs传参

2012-11-01 
SSH+ExtJS框架中Action往Extjs传参我在Action中定义了一个字符串private String exampleset get方法省略p

SSH+ExtJS框架中Action往Extjs传参
我在Action中定义了一个字符串
private String example;
set get方法省略
public String decision(){
this.example = "example";
return SUCCESS;
}
struts.xml中的配置
<action name="feeding_*" 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);
}

热点排行