tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristján Bjarni Guðmundsson <kris...@hugvit.is>
Subject Re: Pb with HEAD request
Date Tue, 26 Nov 2002 15:40:57 GMT
You really should look into the servlet specification.
I think if you override doHead for your servlet

doHead(HttpServletRequest req, HttpServletResponse resp) 

Receives an HTTP HEAD request from the protected service method and 
handles the request.

Default action for doHead is to simply call doGet

Cédric Viaud <cedric.viaud@matrasi-tls.fr> wrote on 26.11.2002 15:32:45:

> Hi,

> I have Tomcat server 4.0.4 on NT 4 that contains a servlets in 
> charge to create SVG content.

> The client is Internet Explorer 5.5. It loads the following simple HTML 
page :

> <html>
> <body>
> <embed width="200" height="200" 
src="http://localhost:8080/myContext/MyServlet
> >
> </body>
> </html>

> The problem is that my servlet is invoked twice.

> My supposition is that IE is sending a HEAD (or GET) request to know
> the content type of the URL and then run the Adobe SVG plugin. When 
> started the plugin connects also the servlet to get SVG content. 
> HTTP spec says that HEAD request must return the same headers as GET
> request. What is sure is that my code is executed twice, not only 
> the part that concerns response headers. But how can I do to know 
> with the servlet if the request is a GET or a HEAD. I test the 
> HttpRequest.getMethod() but it always return "GET".

> Does someone know how to "configure" tomcat or anything else to 
> avoid the two executions ?

> Thanks.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message