ajax调用action成功后,无法进入success

pand33 pand33 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
					$.ajax({
type:'post',
url:'privilegemgmt/resourceAction_updateDep.action',
cache:false ,
dataType:'json',
data:{
id:$('#myform').find('input[name=id]').val() ,
name:$('#myform').find('input[name=name]').val(),
count:$('#myform').find('input[name=count]').val(),
principal:$('#myform').find('input[name=principal]').val(),
description:$('#myform').find('textarea[name=description]').val()
} ,
success:function(data){
var node = $('#tree_org').treegrid('getSelected');
var parent = $('#tree_org').treegrid('getParent' , node.id);
$('#tree_org').treegrid('reload' , parent.id);
$.messager.show({
title:'提示信息',
msg:'操作成功!'
});
},
error:function(XMLResponse){
alert('12345');
}
});

public String updateDep(){
try{
Department dep = new Department();
dep.setId(id);;
dep.setCount(count);
dep.setDescription(description);
dep.setName(name);
dep.setPrincipal(principal);
departmentManager.UpdateDepartment(dep);
String news = "{\"success\":true,\"id\":\"1\"}";
System.out.println(news);
return "success";
}catch(Exception e){
e.printStackTrace();
return null;
}
}


<package name="priviligemgmt" extends="struts-default" namespace="/privilegemgmt">
<action name="resourceAction_*" class="departmentAction" method="{1}">
<result name="input">/Department.jsp</result>
<result name="success">
<param name="root">news</param>
</result>
</action>
</package>

get,set方法都有,执行action方法正确,也按网上教的试了好多,也还是进入不了success..求大神指导
...全文
评论 8
收藏 已收藏
分享
返回顶部
pand33
JavaScript 87,983 成员 224,681 内容