90 CHAPTER 2: Building Web Applications Using Servlets and JSP
In the MVC architecture shown in Figure 2-36, M stands for Category, V stands for home.jsp, and C
stands for BookController. The application flow comprises six steps, as discussed in the following
sections.
Step 1: Locating the Servlet from the Request
The URL (http://localhost:8080/bookWeb/books) is for the dynamic content, so the web server
forwards the request to the servlet container (Tomcat). Listing 2-27 illustrates the Deployment
Descriptor.
Listing 2-27. Deployment Descriptor of the BookstoreWeb App
1.<?xml version="1.0" encoding="UTF-8"?>
2.<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3.xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
4.xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
5.id="WebApp_ID" version="3.0">
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.