For Servlets - as long as
Servlet.service(ServletRequest,ServletResponse) is implemented - you
wont see the 501.
So thats why you see the 501 for your servlet.
JSP's are "funny" since there is nothing in the spec which restricts the
request method. So service(...) is overridden by all JSP's so it will
handle GET/POST/HEAD/??? - which isn't necessarily a bad thing since you
*could* implement PUT (Or any other valid but typically unused method)
in a Servlet and forward to a JSP to render the results.
-Tim
Ronald Klop wrote:
The question is why Tomcat does not return a 501 NOT IMPLEMENTED error
like Apache does?
But I already found something. It does give a 501 when I call my servlet
which only implements doGet, but when it goes to index.jsp the jsp stuff
calls the service() method which doesn't check the http method. Probably
this is ok.
Ronald.
Op maandag, 12 oktober 2009 12:01 schreef "André Warnier" <a...@ice-sa.com>:
Ronald Klop wrote:
> Hi,
> > If I send this to my Tomcat it responds with HTTP/1.1 200 OK and
calls > my servlet. :-)
> telnet localhost 8080
> FOO / HTTP/1.1
> Host: localhost
> > What is this suppost to do?
> :-)
I don't know what is the context, and how you determine that Tomcat is
the target, nor how you know that "your servlet" is being called, but
on the face if it, it does exactly what it is supposed to do.
From the above, the conclusions that can be drawn are :
- there is a webserver on localhost which answers to port 8080
- it has a valid document to return for the URL "/"
- and it is not too picky about HTTP verbs, since it seems to consider
"FOO" as an acceptable alias for "GET"
If you want more information, I am afraid that you will have to supply
more details about your configuration, and maybe explain exactly what
the question is.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org