If I include the <servlet> tags as you describe, I get a "cannot load
servlet name: jsp" entry in my log file:
2001-04-17 09:28:48 - ContextManager: Adding context Ctx( )
Starting tomcat. Check logs/tomcat.log for error messages
No apps in webapps/
2001-04-17 09:28:48 - Ctx( ): Removing duplicate servlet jsp
jsp(org.apache.jas
per.runtime.JspServlet/null)
cannot load servlet name: jsp
2001-04-17 09:28:48 - PoolTcpConnector: Starting Ajp13ConnectionHandler on
8009
2001-04-17 09:28:49 - PoolTcpConnector: Starting Ajp12ConnectionHandler on
8007
If I remove the <servlet> tag altogether, things seem to load just fine, but
the .html extension is not properly interpreted (i.e., the embedded jsp tags
are not executed).
I've included the entirety of my web.xml file below. You'll see I've mapped
2 additional extensions to the JSP engine -- .htm and .zzz -- both of which
work *fine*!
Any ideas?
Thanks in advance for your help.
-jwh
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>
jsp
</servlet-name>
<servlet-class>
org.apache.jasper.runtime.JspServlet
</servlet-class>
<load-on-startup>
-2147483646
</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>
jsp
</servlet-name>
<url-pattern>
*.html
</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>
jsp
</servlet-name>
<url-pattern>
*.htm
</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>
jsp
</servlet-name>
<url-pattern>
*.zzz
</url-pattern>
</servlet-mapping>
</web-app>
-----Original Message-----
From: Tõnu Põld [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 2:21 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Trouble getting Tomcat to parse .html files of JSP tags.
Hi,
You need to specify that the jsp servlet should process the .html files.
Try to add something like this into web.xml file:
<servlet>
<servlet-name>
jsp
</servlet-name>
<servlet-class>
org.apache.jasper.runtime.JspServlet
</servlet-class>
<load-on-startup>
-2147483646
</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>
jsp
</servlet-name>
<url-pattern>
*.html
</url-pattern>
</servlet-mapping>
Look at the example web.xml file in $TOMCAT_HOME/conf directory.
Regards,
Tõnu
> -----Original Message-----
> From: Stuart Allen [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 17, 2001 8:53 AM
> To: [EMAIL PROTECTED]
> Subject: Trouble getting Tomcat to parse .html files of JSP tags.
>
>
> I have been trying for some time now to configure Tomcat/
> Apache to allow
> the inclusion of JSP tags in .html files. In my tomcat-apache
> file, that is
> included at the bottom of http.conf, I have the following lines:
>
> JkMount /mydev/*.html ajp12
> JkMount /mydev/*.jsp ajp12
> JkMount /mydev/servlet/* ajp12
>
> I have two files, index.jsp and index.html in
> $TOMCAT_HOME/webapps/mydev.
> They contain:
>
> <html>
> <head>
> </head>
> <body>
> <jsp:include page="/servlet/HelloWorldExample" flush="true">
> </jsp:include>
> </body>
> </html>
>
> Accessing index.jsp runs the servlet, accessing index.html
> does not. Any
> help with this matter will be greatly appreciated.
>
> Regards,
> Stuart
>