All,

On 1/11/16 9:21 PM, Mark Olsson wrote:
> Adding = to a parameter does cause it to be available to the destination
> servlet, but that doesn't seem like a particularly good solution.  A
> parameter without a value is technically a keyless value, not the other way
> around.  But I'll stick to the servlet terminology of calling them
> parameter names and values since request.getParameterNames and
> getParameterMap both return them as "Names" and not a value without a
> name.  Parameters without a value (keyless value) are widely used and
> within spec without having to add the =.
> 
> I wrote a couple of servlets and have been able to narrow down the problem
> to take form POST data out of the equation, but not been able to find a
> solution yet.  I'm even more convinced that
> getRequestDispatcher().forward() or the receiving servlet are borking the
> parameters.
> 
> This works:
> Directly access /page1?a=1&b&c=3&d
> The request arrives at the servlet with all 4 parameters, a and c have
> values, b and d don't but are in the parameter names list.
> 
> This doesn't work:
> request.getRequestDispatcher("/page1?a=1&b&c=3&d").forward(request,
> response);
> The request arrives at the servlet with only the parameters a and c, not b
> and d.  All 4 parameters are in the query string, but b and d are not in
> the parameter names list or map.
> 
> Seems to me that if the exact same servlet can accept parameters without a
> value on a direct request, but fails on only some parameters when it's from
> a request dispatcher that something is wrong where the parameters are
> gathered the second time, or somewhere before they are made available to
> the destination.

For the benefit of the archives:
https://bz.apache.org/bugzilla/show_bug.cgi?id=58836

This issue was raised in BZ and will be fixed in Tomcat 8.0.31 as well
as others. See the bug for details.

Thanks, Mark, for the bug report and the test case.

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to