SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 72 | Next

Larry Brown, Marty Hall, and Yaakov Chaikin

"Core Servlets and JavaServer Pages, Volume 2"

w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">


Test1
coreservlets.TestServlet1



2.4 Assigning Names and Custom URLs 45

Test1
/UrlTest1

Figure 2??“1 TestServlet1 invoked with http://localhost/deployDemo/UrlTest1.
Exact-Match Patterns
The previous example showed an exact-match pattern: the url-pattern element
specified an address beginning with a slash that did not contain *. The associated
servlet will be invoked when the part of the incoming URL that is after the Web
application prefix (but before the attached GET data, if any) exactly matches the
URL pattern.
Here are a couple more examples using exact matching. Listing 2.3 shows an
excerpt from web.xml declaring and mapping TestServlet2 and TestServlet3
using exact-matching URL patterns. Figures 2??“2 and 2??“3 show the results of invoking
these servlets with their respective URLs.
Listing 2.3 web.xml (Excerpt showing exact matching)

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.


Pages:
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84