我正在使用Apache Tomcat版本的版本apache-tomcat-7.0.65
我的脚本内容是: -
#!/usr/local/bin/perl
print "Content-type:text/html\r\n\r\n";
print <<within_html;
<html>
<head>
<title>TESTING</title>
</head>
<body bgcolor='#FFE4C4'>
<h2>HELLO WORLD</h2>
</body>
</html>
within_html
但我得到的输出如下: -
#!/usr/local/bin/perl print "Content-type:text/html\r\n\r\n"; print <
HELLO WORLD
within_html
我在web.xml中启用了servlet,如下所示: -
<servlet>
<servlet-name>cgi</servlet-name>
<servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</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>
<!-- The mapping for the CGI Gateway servlet -->
<servlet-mapping>
<servlet-name>cgi</servlet-name>
<url-pattern>/cgi-bin/*</url-pattern>
我确实将以下内容添加到了context.xml中
<Context privileged="true">
请帮我修复HTML输出非常感谢你提前帮助。