Servlet declaration and mapping replace your Web

Source: Internet
Author: User
Tags apache tomcat

In Apache 5.0 and 5.5, I need to modify the Servlet name and class name in the web. xml file for each program. These are not seen in Apache Tomcat 4.0. Why?

Jeff Hanson replied: According to Tomcat 5.0 release instructions:

"Let web applications ask CGI and SSI, which is used when a Security Manager program (for example, a malicious Web application can use them to bypass security management programs for Access Control) creates security issues. In Tomcat 5.0, they are all set as not permitted, because our goal is to provide a completely secure default setting. However, CGI and SSI are still usable ."

How to use CGI:

Rename the file $ CATALINA_HOME/server/lib/Servlets-cgi.renametojar to $ CATALINA_HOME/server/lib/Servlets-cgi.jar.

#8226; in the file $ CATALINA_HOME/conf/web. xml, you need to remove the Servlet declaration and mapping from the gaze in two places. The Servlet declaration looks like the following ::

 
 
  1. <servlet> 
  2. <servlet-name>cgi</servlet-name> 
  3. ...  
  4. </servlet> 

Servlet ing looks similar to the following:

 
 
  1. <servlet-mapping> 
  2. <servlet-name>cgi</servlet-name> 
  3. <url-pattern>/cgi-bin/*</url-pattern> 
  4. </servlet-mapping> 

These Servlet declarations and ings can be added to your Web application deployment descriptor alternately.

Make SSI available:

? Rename the file $ CATALINA_HOME/server/lib/Servlets-ssi.renametojar to $ CATALINA_HOME/server/lib/Servlets-ssi.jar.

#8226; in the file $ CATALINA_HOME/conf/web. xml, you need to remove the Servlet declaration and mapping from the gaze in two places. The Servlet declaration looks similar to the following:

 
 
  1. <servlet> 
  2. <servlet-name>ssi</servlet-name> 
  3. ...  
  4. </servlet> 
 

Servlet ing looks similar to the following:

 
 
  1. <servlet-mapping> 
  2. <servlet-name>ssi</servlet-name> 
  3. <url-pattern>*.shtml</url-pattern> 
  4. </servlet-mapping> 
 

These Servlet declarations and mappings can be added to your Web application deployment descriptor alternately.

  1. How to listen to Servlet containers
  2. Introduction to Servlet and JavaServer Page
  3. Introduction to Http Servlet Request objects
  4. Servlet API strength
  5. What is the role of ServletContext?

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.