Java Reference
In-Depth Information
Listing 3-3. web.xml
The interesting part in Listing 3-3 is the URL mapping. It shows that this servlet has
been configured to handle all requests ending with .do in the URL. If you are an experi-
enced Java EE developer and have worked with the Apache Struts framework, you will
immediately see its similarity to the ActionServlet .
On initialization, the DispatcherServlet looks for a configuration file with the naming
convention <servlet-name>-servlet.xml in the WEB-INF folder of the web application. This
XML file contains the configuration information about all the beans, including the page
controllers and view managers that will be managed by the Spring IOC container. The
front controller loads this file to start the Spring web application context and get access
to the Spring IOC container. In our case, this file will be named insurance-servlet.xml .
This is shown in Listing 3-4 with only the page controllers.
Listing 3-4. insurance-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
xsi:schemaLocation="" >
<bean name="/"
<bean name="/"
class=" com.apress.insuranceapp.web.UpdatePolicyController"/>
Search WWH ::

Custom Search