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 73 | Next

Larry Brown, Marty Hall, and Yaakov Chaikin

"Core Servlets and JavaServer Pages, Volume 2"

sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
Chapter 2 ?–  Controlling Web Application Behavior with web.xml 46
Figure 2??“2 TestServlet2 invoked with http://localhost/deployDemo/UrlTest2/.


Test2
coreservlets.TestServlet2



Test2
/UrlTest2/



Test3
coreservlets.TestServlet3



Test3
/UrlTest3.asp



Listing 2.3 web.xml (Excerpt showing exact matching) (continued)
2.4 Assigning Names and Custom URLs 47
Figure 2??“3 TestServlet3 invoked with http://localhost/deployDemo/
UrlTest3.asp.
Multimapping Patterns
In the majority of cases, you want to assign one URL to each servlet. Once in a while,
however, you want multiple URLs to invoke the same servlet. There are two ways
you can accomplish this multimapping:
??? By giving a url-pattern of /directoryName/*, you can specify
that all URLs of the form http://host/webAppPrefix/directoryName/
blah are handled by the designated servlet.


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