SSH中OpenSessionInViewFilter中部分失效原因
当lazy="true"时,会出现以下错误,
could not initialize proxy - no Session
大概意思就是session已经关闭,
很多博客都说设lazy="FALSE"时就没事~
顶小孩都知道
后来找到
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-name>hibernateFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
,还是报错
有跑了一次谷歌,
原来这段是要放到struts Filter前面的~~!我顶