tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <Allistair.Cross...@QAS.com>
Subject RE: Convert URL path from directory/ to directory/index.htm (Spring related)
Date Wed, 29 Jun 2005 13:11:29 GMT
Hi,

You'd normally attempt to do this with URL rewriting at the web server side. I read that tomcat
does not really offer URL rewriting at this time if used as a web server, I could be wrong.

For what it's worth, we place index.jsp documents in folders that the user may request that
do a erquest forward to index.htm which is then picked up by Spring. If using IIS you can
also specifying default documents like index.htm which the web server will try until it gets
a bite from Tomcat

All the best, Allistair.

> -----Original Message-----
> From: Andy [mailto:andy@fritter.net]
> Sent: 29 June 2005 14:18
> To: tomcat-user@jakarta.apache.org
> Subject: Convert URL path from directory/ to 
> directory/index.htm (Spring
> related)
> 
> 
> 
> Hi,
> 
> Is there anyway to get Tomcat to convert a request such as
> myserver.com/directory into myserver.com/directory/index.htm.
> 
> The reason for this is that in Spring you have to specify a
> wild card to match against the URL path in order to invoke
> the DispatcherServlet, if this wild card is *.htm then a
> requested without index.htm in it results in a 404 from Tomcat.
> 
> i.e. myserver.com/directory
>      - gives a 404 response
>      myserver.com/directory/index.htm
>      - invokes Spring to deal with the request
> 
> Perhaps this is an issue I can solve within Spring but
> thought I'd try the Tomcat angle first.
> 
> This is what I have in my web.xml for Spring -
> 
>     <servlet>
>         <servlet-name>abc</servlet-name>
> 
> <servlet-class>org.springframework.web.servlet.DispatcherServl
> et</servlet-cl
> ass>
>         <load-on-startup>1</load-on-startup>
>     </servlet>
> 
>     <servlet-mapping>
>         <servlet-name>abc</servlet-name>
>         <url-pattern>*.htm</url-pattern>
>     </servlet-mapping>
> 
> 
> Thanks,
> 
> Andy.
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 


<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
-------------------------------------------------------
QAS Ltd.
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message