tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy" <a...@fritter.net>
Subject Convert URL path from directory/ to directory/index.htm (Spring related)
Date Wed, 29 Jun 2005 13:18:12 GMT

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.DispatcherServlet</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


Mime
View raw message