前台保存事件js:
$('#fm').form('submit',{
url: url,
onSubmit: function(){
return $(this).form('validate');
},
success: function(result){
$('#dg').datagrid('reload');
var result = eval('('+result+')');
alert(result.message);
if (result.errorMsg){
$.messager.show({
title: 'Error',
msg: result.errorMsg
});
} else {
$.messager.alert("提示","保存成功!");
$('#dlg').dialog('close'); // close the dialog
$('#dg').datagrid('reload'); // reload the user data
}
},
error:function(){
$.messager.alert("提示","保存失败!");
}
});
action类:
/**
* 编辑用户
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
public String updateUser() throws IllegalAccessException, InvocationTargetException{
Users tUser = new Users();
BeanUtils.copyProperties(tUser, user);
int i = usersServiceImpl.updateOne(tUser);
if(i>0){
message="修改成功";
}else{
message="修改失败";
}
jsonMap.put("message", message);
return "success";
}
struts配置:
<package name="default" namespace="/" extends="json-default">
<action name="Users_*" class="usersAction" method="{1}">
<result name="success" type="json">
<param name="root">jsonMap</param>
</result>
</action>
</package>
为什么我保存成功返回前台是会让我下载文件?而不是在回调函数的地方直接取到返回的值?

------解决思路----------------------
分数呢?可能跟浏览器有关,IE比较严格,chrome比较聪明(会去理解用户的目的),具体的细节去百度,书籍等。方法告诉你了,你分数要给我啊。不要我把鱼也抓给你吧。