日期:2014-05-16 浏览次数:20541 次
this.jsonData = "{success:true}";
String jsonStr = jsonData.toString();
ServletActionContext.getResponse().setCharacterEncoding("utf-8");
ServletActionContext.getResponse().setContentType("text/html;charset=utf-8");
ServletActionContext.getResponse().getOutputStream().print(jsonStr);
System.out.println(jsonStr);
return null;
<package name="test" namespace="/test" extends="json-default">
<action name="test" class="test" method="test">
<result type="json">jsonData</result>
</action>
var form = brandForm.getForm();
form.submit({
waitTitle : '请等待' ,
//waitMsg: '正在提交中',
success:function(form, action){
alert("dddd");
//Ext.Msg.alert('信息', '保存成功!');
},
failure:function(form, action){
alert("22222");
//Ext.Msg.alert('错误', '保存失败');
}
});
var form = brandForm.getForm();
form.submit({
url:'test',
method:"POST",
waitTitle : '请等待' ,
//waitMsg: '正在提交中',
success:function(form, action){
alert("dddd");
//Ext.Msg.alert('信息', '保存成功!');
},
failure:function(form, action){
alert("22222");
//Ext.Msg.alert('错误', '保存失败');
}
});