TOMCAT配置问题:我现在开发了一个CGI程序,.EXE形式,我在页面表单的
ACTION里指定是调用这个CGI程序。服务器为TOMCAT,在运行状态下点击表单提交
时弹出一个下载的页面,提示要我下载我的CGI程序,而没有执行该程序。(应该
输出一个页面)。我记得在IIS中就可以指定直接执行CGI程序,请问在TOMCAT中有没有这样的配置?
应该如何配置?

解决方案 »

  1.   

    tomcat是jsp的container, 为什么不用apache
      

  2.   

    呵呵!在Tomcat的conf下面的web.xml
    你把注释掉的这段打开<!-- Common Gateway Includes (CGI) processing servlet, which supports     -->
      <!-- execution of external applications that conform to the CGI spec      -->
      <!-- requirements.  Typically, this servlet is mapped to the URL pattern  -->
      <!-- "/cgi-bin/*", which means that any CGI applications that are         -->
      <!-- executed must be present within the web application.  This servlet   -->
      <!-- supports the following initialization parameters (default values     -->
      <!-- are in square brackets):                                             -->
      <!--                                                                      -->
      <!--   cgiPathPrefix       The CGI search path will start at              -->
      <!--                       webAppRootDir + File.separator + this prefix.  -->
      <!--                       [WEB-INF/cgi]                                  -->
      <!--                                                                      -->
      <!--   clientInputTimeout  The time (in milliseconds) to wait for input   -->
      <!--                       from the browser before assuming that there    -->
      <!--                       is none.  [100]                                -->
      <!--                                                                      -->
      <!--   debug               Debugging detail level for messages logged     -->
      <!--                       by this servlet.  [0]                          -->
      <!--                                                                      -->
      <!-- IMPORTANT: To use the CGI servlet, you also need to rename the       -->
      <!--            $CATALINA_HOME/server/lib/servlets-cgi.renametojar file   -->
      <!--            to $CATALINA_HOME/server/lib/servlets-cgi.jar             --><!--
        <servlet>
            <servlet-name>cgi</servlet-name>
            <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
            <init-param>
              <param-name>clientInputTimeout</param-name>
              <param-value>100</param-value>
            </init-param>
            <init-param>
              <param-name>debug</param-name>
              <param-value>6</param-value>
            </init-param>
            <init-param>
              <param-name>cgiPathPrefix</param-name>
              <param-value>WEB-INF/cgi</param-value>
            </init-param>
             <load-on-startup>5</load-on-startup>
        </servlet>
    -->
      

  3.   

    同意  TOMCAT 默认是不支持CGI的!