在web.xml的配置:
cgi
org.apache.catalina.servlets.CGIServlet
debug
0
passShellEnvironment
true
cgiPathPrefix
WEB-INF/cgi-bin
executable
cmd /c
clientInputTimeout
100
5
<servlet-mapping>
<servlet-name>cgi</servlet-name>
<url-pattern>/cgi-bin/*</url-pattern>
</servlet-mapping>
在context.xml的配置:
cgi
/cgi-bin/*
调用cgi的网页代码:
<!Sample web page for illustrating CGI>
<!Author: M. Liu, 9/15/01>
A Web Page that invokes a Web script
The Web Page illustrates the use of a Web script
This page contains an action tag which specifies a Web script.
Upon retrieving this page from the Web server, the browser
processes the contents and, when the SUBMIT button is pressed,
requests the server to run the script or program specified
with the action tag.
The script o program is either a run-script written in a
script language such asa Perl, or an executable generated
from a source program written in a language such as C/C++
Press to submit your query.
cgi运行不了。求大神指导。
[img]http://dl.iteye.com/upload/attachment/0076/2560/350574ac-02df-3df6-b111-267a895dcb22.png[/img]