解决 org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for cu

在web.xml添加如下代码


<filter>
        <filter-name>SpringOpenSessionInViewFilterfilter-name>
        <filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilterfilter-class>
    filter>
    <filter-mapping>
        <filter-name>SpringOpenSessionInViewFilterfilter-name>
        <url-pattern>/*url-pattern>
    filter-mapping>

你可能感兴趣的:(javaweb)