开发者

JSF2 @ViewScoped + Spring + Hibernate problem: No session

开发者 https://www.devze.com 2023-04-02 05:07 出处:网络
I\'m working on an application that was previously JSF 1.1 compliant but is now in the process of being upgraded to JSF 2.0.

I'm working on an application that was previously JSF 1.1 compliant but is now in the process of being upgraded to JSF 2.0.

There's a service layer and a DAO layer which is managed by Spring. I merge the contexts such开发者_C百科 that the services can be injected directly into JSF ManagedBeans as ManagedProperties. This seems to work fine so far. The problem shows up when I try to use the new @ViewScoped annotation in JSF2. On any first request to the page with the ViewScope bean things work correctly, but any subsequent postbacks to the page fails with "no session" messages littering my log.

I understand that database sessions should not remain open between http requests but I expected a new session to be opened whenever a service method is called. This seems not to be the case.

UPDATE: All my spring beans are singletons (and state-less).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号