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

Larry Brown, Marty Hall, and Yaakov Chaikin

"Core Servlets and JavaServer Pages, Volume 2"

7) with all URLs that begin with
http://host/webAppPrefix/servlet/. Figure 2??“10 illustrates an attempt to access the
TestServlet1 servlet (Listing 2.1 in Section 2.4) with the default URL.
Listing 2.6 web.xml (Excerpt showing how to disable default URLs)

xmlns:xsi="http://www.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">


NoInvoker
coreservlets.NoInvokerServlet


NoInvoker
/servlet/*



Chapter 2 ?–  Controlling Web Application Behavior with web.xml 54
Listing 2.7 NoInvokerServlet.java
package coreservlets;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
/** Simple servlet used to give error messages to
* users who try to access default servlet URLs
* (i.e., http://host/webAppPrefix/servlet/ServletName)
* in Web applications that have disabled this
* behavior.
*/
public class NoInvokerServlet extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.


Pages:
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92