MarcGiffing/wicket-spring-boot

How do I add the OpenSessionInViewFilter

kjertil opened this issue · 3 comments

Hi,

I'm migrating an existing Wicket application to a new platform, and at the same time, switching to spring-boot.

The existing application relies on the OpenSessionInViewFilter, however I'm unsure as to how I enabled this in wicket-spring-boot.

Please advise,

Best regards

Andy.

OSIV is already enabled by Spring Boot by default.
You can disable it by using Spring Boot properties, if you want.

Hi Martin,

Hmmm... weird. I have set a number of breakpoints on the OpenSessionInView class, and it is never called.

But I finally solved my problem by adding the following method to my Configuration file.
@Bean public OpenEntityManagerInViewFilter openEntityManagerInViewFilter() { return new OpenEntityManagerInViewFilter(); }

Best regards
Andy.

Right! I've forgotten that one needs to do this!
Happy coding! :-)