为什么总是报找不到方法的错,可是action里面的其他方法可以找到,就是这个方法找不到,怎么回事?
struts配置:@ParentPackage(value="struts-default")@Namespace(value="/")@Action(value="ro...
struts配置:
@ParentPackage(value = "struts-default")
@Namespace(value = "/")
@Action(value = "roleAction", results = {
@Result(name = "list", location = "/admin/role/list.jsp"),
@Result(name = "add", location = "/admin/role/add.jsp"),
@Result(name = "edit", location = "/admin/role/edit.jsp") })
方法:
public String del() throws Exception {
//ActionContext context = ActionContext.getContext();
String role_id = request.getParameter("role_id");
if (role_id != null && !role_id.equals("")) {
this.roleService.delete(role_id);
}
return "list";
}
跳转语句:
function deleteRole(role_id)
{
var delURL = "<%=path%>/roleAction!del?role_id="+role_id+"&date="+new Date()+"";
window.location.href = delURL;
} 展开
@ParentPackage(value = "struts-default")
@Namespace(value = "/")
@Action(value = "roleAction", results = {
@Result(name = "list", location = "/admin/role/list.jsp"),
@Result(name = "add", location = "/admin/role/add.jsp"),
@Result(name = "edit", location = "/admin/role/edit.jsp") })
方法:
public String del() throws Exception {
//ActionContext context = ActionContext.getContext();
String role_id = request.getParameter("role_id");
if (role_id != null && !role_id.equals("")) {
this.roleService.delete(role_id);
}
return "list";
}
跳转语句:
function deleteRole(role_id)
{
var delURL = "<%=path%>/roleAction!del?role_id="+role_id+"&date="+new Date()+"";
window.location.href = delURL;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询