You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Hardin <jh...@hire.com> on 2001/04/09 08:42:11 UTC

Map ".html" suffix to JSP engine...*how*?

Hi!

I'm running Tomcat 3.2.1 on Redhat Linux 6.2.  I've got it properly
configured to run with Apache (1.3.12).  I've declared the following Context
in conf/server.xml:

        <Context path=""
                 docBase="src/htdocs"
                 debug="0"
                 reloadable="false">
        </Context>

I've declared the following in src/htdocs/WEB-INF/web.xml:

<web-app>
    <servlet-mapping>
        <servlet-name>
            jsp
        </servlet-name>
        <url-pattern>
            *.html
        </url-pattern>
    </servlet-mapping>
</web-app>

However, this causes my jsp pages ("disguised" in files with .html
extensions) to be served up as text/html -- they're NOT executed by the jsp
engine as expected/desired.

What's frustrating is I can map other extensions to the jsp engine (e.g.,
.zzz) -- heck, I can even map .htm and it's properly executed!  Try as I
might, however, I simply can't get .html files to be properly executed by
the jsp engine.  It's as if Tomcat has a hard-wired notion of how .html
files are to be handled.

Does ANYone have ANY idea how to do this?  While I can work around it (e.g.,
rename all of my .html files to .jsp and use an Apache rewrite rule to
effectively map .html to .jsp), at this stage I'd really prefer not to.

Thanks in advance for any/all help.

-jwh

RE: Map ".html" suffix to JSP engine...*how*?

Posted by Danny Angus <da...@thought.co.uk>.
or alter apache's config, to remove html from the list, I think you may want
to look in httpd/conf/apache-mime.types
but it seems a little unlikely if you get htm to work ok.. :-(

> -----Original Message-----
> From: Michael Hale [mailto:mhale@rolemodelsoft.com]
> Sent: Monday, April 09, 2001 9:37 AM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: Map ".html" suffix to JSP engine...*how*?
>
>
> My guess is that apache is serving up the page because it
> thinks it is an
> html page, so tomcat never gets ahold of it.
> I think the only way to fix this is to create your own version of
> mod_jk.conf-auto with JKMount *.html in the appropriate spot.
>  And then
> include your file in apaches httpd.conf.
>
> Michael
>
> -----Original Message-----
> From: John Hardin [mailto:jhardin@hire.com]
> Sent: Monday, April 09, 2001 2:42 AM
> To: 'tomcat-user@jakarta.apache.org'
> Cc: John Hardin
> Subject: Map ".html" suffix to JSP engine...*how*?
>
>
> Hi!
>
> I'm running Tomcat 3.2.1 on Redhat Linux 6.2.  I've got it properly
> configured to run with Apache (1.3.12).  I've declared the
> following Context
> in conf/server.xml:
>
>         <Context path=""
>                  docBase="src/htdocs"
>                  debug="0"
>                  reloadable="false">
>         </Context>
>
> I've declared the following in src/htdocs/WEB-INF/web.xml:
>
> <web-app>
>     <servlet-mapping>
>         <servlet-name>
>             jsp
>         </servlet-name>
>         <url-pattern>
>             *.html
>         </url-pattern>
>     </servlet-mapping>
> </web-app>
>
> However, this causes my jsp pages ("disguised" in files with .html
> extensions) to be served up as text/html -- they're NOT
> executed by the jsp
> engine as expected/desired.
>
> What's frustrating is I can map other extensions to the jsp
> engine (e.g.,
> .zzz) -- heck, I can even map .htm and it's properly
> executed!  Try as I
> might, however, I simply can't get .html files to be properly
> executed by
> the jsp engine.  It's as if Tomcat has a hard-wired notion of
> how .html
> files are to be handled.
>
> Does ANYone have ANY idea how to do this?  While I can work
> around it (e.g.,
> rename all of my .html files to .jsp and use an Apache rewrite rule to
> effectively map .html to .jsp), at this stage I'd really
> prefer not to.
>
> Thanks in advance for any/all help.
>
> -jwh
>


RE: Map ".html" suffix to JSP engine...*how*?

Posted by Michael Hale <mh...@rolemodelsoft.com>.
My guess is that apache is serving up the page because it thinks it is an
html page, so tomcat never gets ahold of it.
I think the only way to fix this is to create your own version of
mod_jk.conf-auto with JKMount *.html in the appropriate spot.  And then
include your file in apaches httpd.conf.

Michael

-----Original Message-----
From: John Hardin [mailto:jhardin@hire.com]
Sent: Monday, April 09, 2001 2:42 AM
To: 'tomcat-user@jakarta.apache.org'
Cc: John Hardin
Subject: Map ".html" suffix to JSP engine...*how*?


Hi!

I'm running Tomcat 3.2.1 on Redhat Linux 6.2.  I've got it properly
configured to run with Apache (1.3.12).  I've declared the following Context
in conf/server.xml:

        <Context path=""
                 docBase="src/htdocs"
                 debug="0"
                 reloadable="false">
        </Context>

I've declared the following in src/htdocs/WEB-INF/web.xml:

<web-app>
    <servlet-mapping>
        <servlet-name>
            jsp
        </servlet-name>
        <url-pattern>
            *.html
        </url-pattern>
    </servlet-mapping>
</web-app>

However, this causes my jsp pages ("disguised" in files with .html
extensions) to be served up as text/html -- they're NOT executed by the jsp
engine as expected/desired.

What's frustrating is I can map other extensions to the jsp engine (e.g.,
.zzz) -- heck, I can even map .htm and it's properly executed!  Try as I
might, however, I simply can't get .html files to be properly executed by
the jsp engine.  It's as if Tomcat has a hard-wired notion of how .html
files are to be handled.

Does ANYone have ANY idea how to do this?  While I can work around it (e.g.,
rename all of my .html files to .jsp and use an Apache rewrite rule to
effectively map .html to .jsp), at this stage I'd really prefer not to.

Thanks in advance for any/all help.

-jwh