On Jun 29, 2011, at 6:21 PM, jeromeernestgarcia wrote: > We have a web page that uses the Dojo toolkit which issues a OPTIONS request > prior to a GET. The javascript is sending these requests to a Java > HTTPServlet instance managed by Geronimo. The OPTIONS request fails because > the server responds with a "302 Moved Temporarily" response. > > I have overridden the doOptions method in my HTTPServlet subclass but that > never gets called. Since that failed, I added an override of > service(ServletRequest req, ServletResponse res) and set breakpoints all the > way down to Http11ConnectionHandler trying to find out where the OPTIONS > method is being blocked. It seems like it never get in.
Which distribution (Jetty/Tomcat) and version of Geronimo are you using? What does your web.xml/geronimo-web.xml contain? > > I also tried to do some telnet experiments: > > telnet localhost 8080 > OPTIONS / HTTP/1.1 > host: localhost > This gives a good response > > telnet localhost 8080 > OPTIONS /demandResponse HTTP/1.1 > Host: localhost:8080 > This returns "HTTP/1.1 302 Moved Temporarily" What is the redirect address? > > telnet localhost 8080 > GET /demandResponse HTTP/1.1 > Host: localhost:8080 > This returns "HTTP/1.1 302 Moved Temporarily" > > Copying the URL for the GET request into a browser and sending the request > results in the correct call to the HTTPServlet.doGet method. > > Can anyone explain why this happens and what I need to do to get the > HTTPServlet.doOptions method called? Well, your browser is handling the redirect, automatically. Telnet, is not... ;-) --kevan
