You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "J.W. Janssen (JIRA)" <ji...@apache.org> on 2014/07/30 11:38:38 UTC

[jira] [Comment Edited] (FELIX-4589) Problem with forwarding from one servlet to another

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

J.W. Janssen edited comment on FELIX-4589 at 7/30/14 9:37 AM:
--------------------------------------------------------------

Hmm, not sure what might cause this, given that [1] does several tests wrt request dispatching. Perhaps the issue is in the Http Bridge...?

Edit 1: can reproduce the issue locally when using 
{code}
RequestDispatcher rd = getServletContext().getRequestDispatcher(ForwardServlet.SERVLET_ALIAS);
{code}
but replacing that line with
{code}
RequestDispatcher rd = req.getRequestDispatcher(ForwardServlet.SERVLET_ALIAS);
{code}
works correctly.

1. http://svn.apache.org/repos/asf/felix/trunk/http/itest/src/test/java/org/apache/felix/http/itest/RequestDispatchTest.java


was (Author: jajans):
Hmm, not sure what might cause this, given that [1] does several tests wrt request dispatching. Perhaps the issue is in the Http Bridge...?

[1] http://svn.apache.org/repos/asf/felix/trunk/http/itest/src/test/java/org/apache/felix/http/itest/RequestDispatchTest.java

> Problem with forwarding from one servlet to another
> ---------------------------------------------------
>
>                 Key: FELIX-4589
>                 URL: https://issues.apache.org/jira/browse/FELIX-4589
>             Project: Felix
>          Issue Type: Bug
>          Components: HTTP Service
>    Affects Versions: http-2.3.0
>            Reporter: Victor Bashurov
>
> Like in an issue FELIX-2774 (https://issues.apache.org/jira/browse/FELIX-2774) I'd like to have a several servlet bunles installed with embedded OSGI framework. I'm using servlet bridge for request's management between sevlets bundles. In order to pass the information between servlets I want to use request dispatcher to forward (or include) http queries from one servlet to another. 
> Even when I have two servlets registered in one bundle I cannot make a forwarding from one servlet to another.
> ServiceTracker
> httpService.registerServlet(TestServlet.SERVLET_ALIAS,	new TestServlet("Test servlet"), null, null);			httpService.registerServlet(ForwardServlet.SERVLET_ALIAS,	new ForwardServlet("Forward servlet"), null, null);
> Trying to do the following in a TestServlet doGet method will cause error:
> RequestDispatcher rd = getServletContext().getRequestDispatcher(ForwardServlet.SERVLET_ALIAS);
> rd.forward(req, res);
> For org.apache.felix.http.bridge-2.0.2.jar error will be NullPointerException on 'rd' variable, for version 2.2.0 the same, but for version 2.3.0 it's going to be endless loop and stackoverflow error.
> More code about the problem here: https://bitbucket.org/vbashur/diff/src (servletbundle project)



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