You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Edmund Urbani <em...@liland.org> on 2005/07/01 15:43:10 UTC
how do i prevent tomcat5 from adding trailing slash?
hi!
i ran into some trouble with tomcat5 and its slash adding behaviour.
there's this MS WebFolder client (M$ for WebDAV), that does not seem to
be able to cope with status 302 redirects in some situations. in order
to work around this problem i modified the class
org.apache.tomcat.util.http.mapper.Mapper, so it would not add a
trailing slash for an URL like http://host:8080/slide. But since I
really don't want to (and usually don't need to) change anything about
tomcat, I'd rather have a configuration option for this. I know that the
old tomcat4 did not do redirects for this either, so I thought maybe
someone would add a config option to revert to that old behaviour.
if not, is there a any way to prevent this redirect without modifying
tomcat5's source?
Cheers,
Edmund
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: how do i prevent tomcat5 from adding trailing slash?
Posted by Edmund Urbani <em...@liland.org>.
Bill Barker wrote:
>"Edmund Urbani" <em...@liland.org> wrote in message
>news:42C5486E.2010700@liland.org...
>
>
>>hi!
>>
>>i ran into some trouble with tomcat5 and its slash adding behaviour.
>>there's this MS WebFolder client (M$ for WebDAV), that does not seem to
>>be able to cope with status 302 redirects in some situations. in order
>>to work around this problem i modified the class
>>org.apache.tomcat.util.http.mapper.Mapper, so it would not add a
>>trailing slash for an URL like http://host:8080/slide. But since I
>>really don't want to (and usually don't need to) change anything about
>>tomcat, I'd rather have a configuration option for this. I know that the
>>old tomcat4 did not do redirects for this either, so I thought maybe
>>someone would add a config option to revert to that old behaviour.
>>
>>if not, is there a any way to prevent this redirect without modifying
>>tomcat5's source?
>>
>>
>>
>
>I'm too lazy to look at the commit log to see what TC 5 version it was
>changed in, but if you use <url-pattern>/*</url-pattern> for your webdav
>servlet instead of <url-pattern>/</url-pattern>, Tomcat will not send the
>302 response for a directory request.
>
>
thank you, thank you, thank you, thank you!!
it works. that's the kind of mail i like to see in my inbox when
i get into the office monday morning :)
i also had to change slide's "default-servlet" parameter to false to
make it work.
Edmund
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: how do i prevent tomcat5 from adding trailing slash?
Posted by Bill Barker <wb...@wilshire.com>.
"Edmund Urbani" <em...@liland.org> wrote in message
news:42C5486E.2010700@liland.org...
>
> hi!
>
> i ran into some trouble with tomcat5 and its slash adding behaviour.
> there's this MS WebFolder client (M$ for WebDAV), that does not seem to
> be able to cope with status 302 redirects in some situations. in order
> to work around this problem i modified the class
> org.apache.tomcat.util.http.mapper.Mapper, so it would not add a
> trailing slash for an URL like http://host:8080/slide. But since I
> really don't want to (and usually don't need to) change anything about
> tomcat, I'd rather have a configuration option for this. I know that the
> old tomcat4 did not do redirects for this either, so I thought maybe
> someone would add a config option to revert to that old behaviour.
>
> if not, is there a any way to prevent this redirect without modifying
> tomcat5's source?
>
I'm too lazy to look at the commit log to see what TC 5 version it was
changed in, but if you use <url-pattern>/*</url-pattern> for your webdav
servlet instead of <url-pattern>/</url-pattern>, Tomcat will not send the
302 response for a directory request.
> Cheers,
> Edmund
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org