Implementation of some Tomcat configurations

Source: Internet
Author: User

1. Add a virtual directory (that is, you can use this element to set web applications that are not in the default webapps folder of Tomcat.Program)
Add <context Path = "/OICQ" docbase = "myweb" DEBUG = "0" reloadable = "true"> to the server. xml file.
</Context>
Myweb indicates its location relative to webapps, which is a physical directory;
/OICQ indicates its relative web URL path, which is a virtual path, for example, http: // localhost/OICQ
Another example:
<Context Path = "/jspandservletcookbook" reloadable = "true" docbase = "G:/resource/Java/jspandservletcookbook" workdir = "G: /resource/Java/jspandservletcookbook/Work "/>

2 enable Servlet
One reason for creating a custom URL for the servlet or JSP page is that you can register to read the initialization parameters from the init (servlet) or jspinit (JSP page) method. However, the initialization parameter can be used only when the servlet or JSP page is accessed using the custom URL mode or registration name. The default URL http: // host/webappprefix/servlet/servletname cannot be used for access. Therefore, you may want to disable the default URL so that no one will call the initialization servlet accidentally. This process is sometimes called the Enable servlet, because most servers have a standard servlet registered with the default servlet URL and activate the actual servlet of the default URL application.

There are two main ways to disable this default URL:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.