Chapter 5: Basic Tomcat Confi guration For example,

Chapter 5: Basic Tomcat Confi guration For example, if the host is www.wrox.com, and a standalone version of the Tomcat 6 server is running, then the following URL will map to the servlet named default: http://www.wrox.com// The portion defaults to the name of the application s WAR file if not explicitly specified in a element. If you look back at the definition earlier in this file, you see that it was specified that the org.apache.catalina.servlets.DefaultServlet will be handling this request. The second is commented out because it is for the security-sensitive invoker servlet. You may uncomment this to enable the invokerservlet in test configurations: invoker /servlet/* –> The rule here specifies the following: When you see a URL request fitting the pattern /servlet/* , route it to the invokerservlet. Therefore, the following URL request is sent to a servlet called invoker: http://www.wrox.com//servlet/ If you refer back in the file, the org.apache.catalina.servlets.InvokerServletis specified to process the request. This invokerservlet in turn invokes the servlet that is named by examining the incoming URL. The next two elements specify that all URLs containing *.jspand *.jspxshould be passed to the servlet named jsp for processing. In the earlier , the jspservlet is declared to be the org.apache.jasper.servlet.JspServletclass: jsp *.jsp jsp *.jspx How server.xml, Context Descriptors, and web.xml Work Together Figure 5-3 illustrates how an incoming URL is parsed by the various components of a Tomcat 6 server, and how a with a controls the final mapping of the request to a specific servlet in a Web application.

For high quality java hosting services please check tomcat web hosting website.

Comments are closed.