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; }問題得到了解決新聞熱點
疑難解答