天天看點

openSessionInView 配置備忘

配置openSessionInView的時候發現并沒有起作用

最後發現原因是:

在web.xml中 osiv的filter在webwork的filter之後。

參考自http://www.iteye.com/topic/20671

這是web.xml裡的配置,注意下面的前後順序

Java代碼

上面的<filter-mapping>順序就會使OpenSessionInView失效.正确的順序應該是

Java代碼

即opensession的<filter-mapping>應該位于webwork的<filter-mapping>前