Hi,

Sling's request dispatcher implementation does not support request parameters. 
We never needed it and thus never implemented it.

Yes, this is kind of a violation and having support for request parameters 
would be great, probably.

Along these lines, let me repeat the OpenSource mantra: Patches welcome ;-)

Thanks and Regards
Felix

Am 13.12.2012 um 23:48 schrieb David G.:

> Hey all,
> 
> Should this be considered a bug? It seems like sling.forward() or even 
> explicitly using RequestDispather.forward() throws a resource not found 
> exception if the path has Query params.  Same for include(..).
> 
> In my case the path points to a functioning servlet.
> 
> The Java Servlet Spec seems to think it should work. Am I missing something 
> -- I tend to give you guys the benefit of the doubt that the error is on my 
> end ;)
> 
> Thanks!
> 
> -------
> 
> String  test1 = "/bin/myservlet.json";
> String  test2 = "/bin/myservlet.json?foo=bar";
> 
> 
> sling.forward(test1);
> slingRequest.getRequestDispatcher(test1).forward(request, response);
> // Works
> 
> sling.forward(test2);
> slingRequest.getRequestDispatcher(test2).forward(request, response);
> 
> // Resource Not Found exception
> 
> -------
> SRV.8.1.1 Query Strings in Request Dispatcher Paths The ServletContext and 
> ServletRequest methods that create RequestDispatcher objects using path 
> information allow the optional attachment of query string information to the 
> path. For example, a Developer may obtain a RequestDispatcher by using the 
> following code: String path = “/raisins.jsp?orderno=5”; RequestDispatcher rd 
> = context.getRequestDispatcher(path); rd.include(request, response); 
> Parameters specified in the query string used to create the RequestDispatcher 
> take precedence over other parameters of the same name passed to the included 
> servlet. The parameters associated with a RequestDispatcher are scoped to 
> apply only for the duration of the include or forward call.
> 
> 
> 
> 
> 
> --  
> David Gonzalez
> Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
> 

Reply via email to