首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

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

2012-11-07 
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即可。

热点排行