SSIB配备中遇到No result defined for action action.deptAction and result success

SSIB配置中遇到No result defined for action action.deptAction and result successSSIB配置中遇到No res

SSIB配置中遇到No result defined for action action.deptAction and result success

SSIB配置中遇到No result defined for action action.deptAction and result success的错误。

JSP代码:

<s:form action="deptAction" namespace="/" > <s:textfield name="deptName" label="用户名"></s:textfield><s:password name="deptNo" label="密码"></s:password><s:submit value="确定"></s:submit></s:form>

?deptAction.java代码:

public String excute(){DeptW dept = null;if((String.valueOf(deptNo) != null && String.valueOf(deptNo).length()>0) && (deptName != null && deptName.length()>0)){try{dept = (DeptW)ddao.selectByPrimaryKey(deptNo);}catch(Exception e){System.out.print(e.getMessage());loc = e.getMessage();return "dept";}if(dept != null){int dno = dept.getDeptno();String dname = dept.getDname().toString();if(String.valueOf(dno).equals(deptNo)){session.put("deptName", dname);return "index";}else{loc="编号错误";return "dept";}}else{loc="员工编号和姓名不能为空";return "dept";}}return "index";    }

?

struts.xml代码:

?

<package name="default" extends="struts-default" namespace="/">      <action name="deptAction" value="spring"/>

?

运行时出现Could not find action or result
No result defined for action action.deptAction and result success错误。

?

解决方法:将struts.xml文件中的index改成success,然后将deptAction.java文件中的index都改成success即可。