Java Reference
In-Depth Information
<dependency>
<groupId>OMSJavabean</groupId>
<artifactId>OMSJavabean</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
</dependency>
</dependencies>
<build>
<finalName>OMSWeb</finalName>
</build>
</project>
As shown in the
pom.xml
file in Listing 7-1, running the Maven install goal will pro-
duce a web application archive (WAR) file. I will now show how to modify
web.xml
to
register the Spring dispatcher or front controller servlet. As mentioned in Chapter 3, this
servlet will load the Spring configuration from an XML configuration file starting with
the name of the servlet in
web.xml
. The Spring application context loaded by this servlet
will be a child of the parent application context loaded by the Spring context listener.
The parent application context is loaded from the classpath resource
applicationContext-security.xml
. Listing 7-2 shows
web.xml
.
Listing 7-2.
web.xml
<?xml version=
"1.0"
encoding=
"UTF-8"
?>
<web-app version="2.4" xmlns="
http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/j2ee
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext-security.xml
</param-value>
</context-param>
