This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the
Struts dispatcher needed for this tag. - [unknown location]原因:struts2的过滤器映射路径写错解决方案:在web.xml中配置struts2的过滤器如下:<filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern></filter-mapping>注意:<url-pattern>这里一定要是 /*通过页面表单提交一些要修改数据库中数据的操作,表单提交之后,程序运行一切正常,而且,后台也打印出了sql语句,例如:insert into SYS.HNCITEM05 (SNAME, BATE, SONO, SDATE, SNO) values (?, ?, ?, ?, ?),但是,数据库中却查不到刚才插入的数
据。就是说:数据并没有真正写入数据库。 原因:hibernate配置错误 解决方案:Hibernate中设置事务自动提交即在Hibernate配置文件中进行如下设置 : <property name="connection.autocommit">true</property> (<!-- 设置事务自动提交(默认为false,false的话,程序对数据库的操作都不会作为事务提交) -->) 一切就OK了。异常Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'userDao' must be of type [com.changetech.dao.impl.UserDaoImpl], but was actually of type [$Proxy16]
原因如下: @Resource(name="userDao") protected UserDaoImpl userDao; public void setUserDao(UserDaoImpl userDao) { this.userDao = userDao; }原来在定义Dao时,没有用接口,而直接使用的是Dao的实现类解决方案:改为如下: @Resource(name="userDao") protected UserDao userDao; public void setUserDao(IUserDao userDao) { this.userDao = userDao; }问题得到了解决新闻热点
疑难解答