Java Reference
In-Depth Information
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.<display-name>bookWeb</display-name>
7.<servlet>
8.<servlet-name>BookServlet</servlet-name>
9.<servlet-class>com.apress.bookweb.controller.BookController</servlet-class>
10.<init-param>
11.<param-name>base</param-name>
12.<param-value>/bookWeb/books</param-value>
13.</init-param>
14.<init-param>
15.<param-name>imageURL</param-name>
16.<param-value>/bookWeb/images</param-value>
17.</init-param>
18.<load-on-startup>1</load-on-startup>
19.</servlet>
20.<context-param>
21.<param-name>param1</param-name>
22.<param-value>/bookWeb/books</param-value>
23.</context-param>
24.<context-param>
25.<param-name>imageURL</param-name>
26.<param-value>/bookWeb/images</param-value>
27.</context-param>
28.<servlet-mapping>
29.<servlet-name>BookServlet</servlet-name>
30.<url-pattern>/books </url-pattern>
31.</servlet-mapping>
32.<welcome-file-list>
33.<welcome-file>index.html</welcome-file>
34.<welcome-file>index.htm</welcome-file>
35.<welcome-file>index.jsp</welcome-file>
36.<welcome-file>default.html</welcome-file>
 
Search WWH ::




Custom Search