[
https://issues.apache.org/jira/browse/OLINGO-307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14312098#comment-14312098
]
Eugenio Lentini commented on OLINGO-307:
----------------------------------------
Hi,
I am currently use version 2.0.2.
I have checked the link from [[email protected]]] but often we do not have
control on the app server of the client. Moreover I do not know if this can
impact other deployed web applications. Is it possible to have a fix inside of
the ODataServlet?
For the time being I have just commented out the if line if (req.getPathInfo()
!= null)
{code:title=ODataServlet.java|borderStyle=solid}
// previous lines
@Override
protected void service(final HttpServletRequest req, final HttpServletResponse
resp) throws IOException
{
// previous lines
// if (req.getPathInfo() != null)
// {
handle(req, resp, xHttpMethod, xHttpMethodOverride, serviceFactory);
// }
// else
// {
// handleRedirect(req, resp, serviceFactory);
// }
}
{code}
and it works, I do not know if this could lead to some other issues in the
future.
Thanks a lot for the help.
> 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)