I\'m a Spring newbie trying my first app. My hibernate gets closed before the view is rendered and having problems with lazy loaded properties (expected behavior). I\'ve added
My controllers where initialized twice, the same config was used by the root ApplicationContext and by the FrameworkServlet. I've had two contexts initialized. I've created a config for the root context named springapp.xml and moved all my middle tier configuration there and left my web tier configuration in springapp-servlet.xml
My web.xml now looks like this and everything works fine:
contextConfigLocation
/WEB-INF/springapp.xml
org.springframework.web.context.ContextLoaderListener
hibernateFilter
org.springframework.orm.hibernate4.support.OpenSessionInViewFilter
sessionFactoryBeanName
sessionFactory
hibernateFilter
/*
REQUEST
FORWARD
springapp
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
/WEB-INF/springapp-servlet.xml
1
springapp
/