You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Eugenio Lentini (JIRA)" <ji...@apache.org> on 2014/05/28 16:36:01 UTC

[jira] [Commented] (OLINGO-307) Issue handling the redirect in ODataServlet

    [ https://issues.apache.org/jira/browse/OLINGO-307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14011143#comment-14011143 ] 

Eugenio Lentini commented on OLINGO-307:
----------------------------------------

Hi,
I have done some tests and with what I have suggested it does not work, I have had a look at the code it is not very clear what you should be the behavior if the getPathInfo() returns null. Actually this is, I guess, a different but valid behavior of the web container.

Basically, for the time being, I have created a copy of the ODataServlet where I have commented out that block of code leaving just
handle(req, resp, xHttpMethod, xHttpMethodOverride);

and for the time being it works, but I would like to have a better and proper fix.

Thanks a lot for your attention.
Eugenio

> Issue handling the redirect in ODataServlet
> -------------------------------------------
>
>                 Key: OLINGO-307
>                 URL: https://issues.apache.org/jira/browse/OLINGO-307
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-core
>            Reporter: Eugenio Lentini
>            Priority: Blocker
>
> Hi,
> as I have been suggested I am using the ODataServlet instead of the Cxf or Jersey one but I guess there is an issue handling the redirection.
> Basically I have a plain filter used to authorize the user before the call to the servlet. I have tested in Glassfish 3, Glassfish 4 and Jetty and the redirection works great.
> The issue appears in IBM Websphere which probably interprets the specification in a slightly different way so in ODataServlet line 91
> if (req.getPathInfo() != null) {
>       handle(req, resp, xHttpMethod, xHttpMethodOverride);
>     } else {
>       handleRedirect(req, resp);
>     }
> the req.getPathInfo() is equal to null when in Glassfish, for instance, is "/" submitting the following request
> http://localhost:9080/context-root/odata.svc/?foo=1&bar=2
> In handle redirect method there is
> ODataResponse.status(HttpStatusCodes.TEMPORARY_REDIRECT)
>           .header(HttpHeaders.LOCATION, "/").build();
> so after the redirect the request points to http://localhost:9080/ as normal, which produces in WebSphere
> Error 404: com.ibm.ws.webcontainer.servlet.exception.NoTargetForURIException: No target servlet configured for uri: /
> So I guess instead of "/" there should be something like req.getContextPath()
> Thanks a lot for the attention.
> Eugenio



--
This message was sent by Atlassian JIRA
(v6.2#6252)