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 last published in October 2005

Dig Deeper on SOA, XML and Web Services Development Tools

PRO+

Content

Find more PRO+ content and other member only offers, here.

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.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close