You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andreas Schildbach <an...@schildbach.de> on 2005/03/04 09:06:49 UTC
Problem with Welcome File mapped to a Servlet
Hello everyone,
I'm using Tomcat 5.0 and Servlet Spec 2.4.
I have defined a servlet mapping all *.html and a standard welcome file,
as follows:
<servlet>
<servlet-name>test</servlet-name>
<servlet-class>Test</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
Unfortunately, this does not work as expected. My servlet receives all
requests ending on .html, but not any "directory" URLs, which are
answered with an 404 error instead.
Examples:
http://mydomain/myapp/bla.html => received by servlet, ok
http://mydomain/myapp/index.html => received by servlet, ok
http://mydomain/myapp/ => answered with 404, but should be received?!?
http://mydomain/myapp/dir/ => answered with 404, should be received?!?
I don't understand why this does not work. Can anyone help me?
Regards,
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Problem with Welcome File mapped to a Servlet
Posted by Tim Funk <fu...@joedog.org>.
See bugzilla and search for welcome-files - I believe this was talked about a
few times.
-Tim
Andreas Schildbach wrote:
> Hello everyone,
>
> I'm using Tomcat 5.0 and Servlet Spec 2.4.
>
> I have defined a servlet mapping all *.html and a standard welcome file,
> as follows:
>
> <servlet>
> <servlet-name>test</servlet-name>
> <servlet-class>Test</servlet-class>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>test</servlet-name>
> <url-pattern>*.html</url-pattern>
> </servlet-mapping>
>
> <welcome-file-list>
> <welcome-file>index.html</welcome-file>
> </welcome-file-list>
>
> Unfortunately, this does not work as expected. My servlet receives all
> requests ending on .html, but not any "directory" URLs, which are
> answered with an 404 error instead.
>
> Examples:
>
> http://mydomain/myapp/bla.html => received by servlet, ok
> http://mydomain/myapp/index.html => received by servlet, ok
> http://mydomain/myapp/ => answered with 404, but should be received?!?
> http://mydomain/myapp/dir/ => answered with 404, should be received?!?
>
> I don't understand why this does not work. Can anyone help me?
>
> Regards,
>
> Andreas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org