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 2015/02/06 18:00:39 UTC

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

     [ https://issues.apache.org/jira/browse/OLINGO-307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eugenio Lentini reopened OLINGO-307:
------------------------------------

Sorry guys but the issue is still here.

I still have the same scenario as before, IBM WebSphere probably handles context path in a different way and ends up in a redirect like this

servlet/res.svc//

so I lose all the query parameters after it passes inside of handleRedirect method.

req.getPathInfo() is null so it enters inside of the method
handleRedirect(req, resp, serviceFactory);

removing the if block it enters into
handle(req, resp, xHttpMethod, xHttpMethodOverride, serviceFactory);

method and the behavior is as expected.

I do not understand why this issue is back when has been marked as resolved, could you please fix it?

For the time being I am still using my old ODataServlet class patched.

Thanks a lot for the 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
>    Affects Versions: V2 1.2.0
>            Reporter: Eugenio Lentini
>            Assignee: Michael Bolz
>            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.3.4#6332)