在IE中跳转提示错误 Unable to instantiate Action, action.Action, defined for 'select' in namespace '/

Unable to instantiate Action, action.Action, defined for 'select' in namespace '/'获取配置文件[sqlMap/sqlMapConfig.xml]SqlMapClient实例失败! - action - file:/E:/Program/apache-tomcat-6.0.18/webapps/stu/WEB-INF/classes/struts.xml:10:7

package action; import bean.Student; import daoimpl.StudentDaoImpl; public class Action extends TCBaseAction{ private static final long serialVersionUID = 1L; private Student stu; StudentDaoImpl studentImpl=new StudentDaoImpl(); public String select(){ Student stu1=studentImpl.queryObject(stu); if(stu1!=null){ save("stu",stu1); return SUCCESS; }else{ return FAIL; } } public Student getStu() { return stu; } public void setStu(Student stu) { this.stu = stu; } }
<?xml version="1.0" encoding="gbk" ?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="Student">
<typeAlias alias="student" type="bean.Student" />
<!-- 查询 Object -->
<select id="queryObject" parameterClass="student" resultClass="student">
SELECT name AS name,ID AS ID,sex AS sex,age AS age,zhuanye AS zhuanye,xibie AS xibie,banji AS banji
FROM tab1
WHERE name=#name#
</select>
</sqlMap>

第1个回答  2012-05-09
无法实例化Action,看看struts-config.xml里面form-bean和action有没有配置追问

请你看看这个。怎么往里配置?用哪个语言?

追答

请帖struts-config.xml文件,struts问题,不是ibatis问题

追问

就两个xml文件 我都贴上去的

追答

wWebRoot/web-inf/struts-config.xml...
用action一定要有struts啊,没这个配置文件咋个跑得起....
百度搜索struts教程...