Java Reference
In-Depth Information
classpath:/placeOrderService-exposedDomain-beans.xml
…
</param-value>
</context-param>
<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
bb
<filter-class>
bb
org.springframework.orm.hibernate.support.OpenSessionInViewFilter
bb
</filter-class>
<init-param>
<param-name>sessionFactoryBeanName</param-name>
<param-value>mySessionFactory</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
b
<url-pattern>/updateDeliveryInfo</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet
➥
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>UpdateDeliveryInfoServlet</servlet-name>
<servlet-class>
net.chrisrichardson.foodToGo.ui.domain.servlets.
bb
b
➥
UpdateDeliveryInfoServlet
</servlet-class>
</servlet>
…
</web-app>
The web.xml in listing 8.4 is quite similar to the
JDO
version we saw earlier. The
main difference is that it uses the Hibernate-specific
OpenSessionInViewFilter
.
The
OpenSessionInViewFilter
is configured to use the session factory named
mySessionFactory
, which it retrieves from the web application's
ApplicationCon-
text
. This web.xml file, along with the Spring bean configuration files, the appli-
cation classes, and the required libraries, would be packaged as a web application
and deployed in a web container.
Search WWH ::
Custom Search