Q

Changing the servlet context in Apache 5.x

A SearchWebServices.com member asks one of our experts, "In Apache 5.0 and 5.5, for every program, I need to change the servlet name, class name, etc in the web.xml file. This doesn't seem to the case in Apache Tomcat 4.0. Why?" Read the response or pose a question of your own.

In Apache 5.0 and 5.5, for every program, I need to change the servlet name, class name, etc in the web.xml file. This doesn't seem to the case in Apache Tomcat 4.0. Why?

According to the Tomcat 5.0 release notes:

"Having CGI and SSI available to web applications created security problems when using a security manager (as a malicious Web application could use them to sidestep the security manager access control). In Tomcat 5.0, they have been disabled by default, as our goal is to provide a fully secure default configuration. However, CGI and SSI remain available.

To enable CGI:

  • rename the file $CATALINA_HOME/server/lib/servlets-cgi.renametojar to $CATALINA_HOME/server/lib/servlets-cgi.jar.
  • in $CATALINA_HOME/conf/web.xml, you will need to uncomment 2 areas, the servlet declaration and the servlet mapping. The servlet declaration looks similar to this:

    <servlet>
        <servlet-name>cgi</servlet-name>
        ...
    </servlet>

While the servlet mapping looks similar to this:

    <servlet-mapping>
        <servlet-name>cgi</servlet-name>
        <url-pattern>/cgi-bin/*</url-pattern>
    </servlet-mapping>

Alternately, these servlet declarations and mappings can be added to your Web application deployment descriptor.

To enable SSI:

  • * rename the file $CATALINA_HOME/server/lib/servlets-ssi.renametojar to $CATALINA_HOME/server/lib/servlets-ssi.jar.
  • in $CATALINA_HOME/conf/web.xml, you will need to uncomment 2 areas, the servlet declaration and the servlet mapping. The servlet declaration looks similar to this:

    <servlet>
        <servlet-name>ssi</servlet-name>
        ...
    </servlet>

While the servlet mapping looks similar to this:

    <servlet-mapping>
        <servlet-name>ssi</servlet-name>
        <url-pattern>*.shtml</url-pattern>
    </servlet-mapping>

Alternately, these servlet declarations and mappings can be added to your Web application deployment descriptor."

This was first published in October 2005

Dig deeper on SOA, XML and Web Services Development Tools

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close