You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by jeromeernestgarcia <je...@gridata.com> on 2011/06/30 00:21:01 UTC
HTTPServlet.doOptions not called
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.
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"
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?
Thanks,
Jerome
--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/HTTPServlet-doOptions-not-called-tp3123720p3123720.html
Sent from the Users mailing list archive at Nabble.com.
Re: HTTPServlet.doOptions not called
Posted by Kevan Miller <ke...@gmail.com>.
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