You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jim Bartram <jb...@quadrivium-labs.com> on 2002/07/12 06:16:30 UTC

Altering file extensions

I'm using Tomcat 4.0 in a very simple way, hosting some straightforward
.jsp files. Instead of the client seeing files served with the *.jsp
extension, I'd like to be able to substitue anothe extension instead --
like *.html :-). Is there a way to do that in Tomcat ? If so, how do I go
about it?

--Jim Bartram

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Altering file extensions

Posted by Martin Jacobson <ma...@libero.it>.
Jim Bartram wrote:

> I'm using Tomcat 4.0 in a very simple way, hosting some straightforward
> .jsp files. Instead of the client seeing files served with the *.jsp
> extension, I'd like to be able to substitue anothe extension instead --
> like *.html :-). Is there a way to do that in Tomcat ? If so, how do I go
> about it?
> 


This is what the <servlet-mapping> element does (I don't use JSPs, but 
it works fine for servlets).

e.g.

<servlet>
   <servlet-name>hello</servlet-name>
   <jsp-file>hello.jsp</jsp-file>
   ...
</servlet>

<servlet-mapping>
   <servlet-name>hello</servlet-name>
   <url-pattern>hello.html</url-pattern>
</servlet-mapping>

So your user types hello.html, and gets served the output from hello.jsp.

HTH,
Martin



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>