解決SpringMVC+Hibernate錯誤: No Hibernate Session bound to thread

banq發表於2011-05-19
How I resolved SpringMVC+Hibernate Error: No Hibernate Session bound to thread | Javalobby

解決辦法
1.如果你將所有控制器放在一個包下,配置檔案加入:<context:component-scan base-package="com.sivalabs.appname.web.controllers"/>

2.如Controller, Service, DAO在不同包package下。配置檔案加入:
<context:component-scan base-package="com.sivalabs" use-default-filters="false">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>

相關文章