Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Why do empty url parameters lead to multiple values (null, "") returned by getParameterValues

Hi again,

I was able to diagnose the code further, and it actually is a bug in the OSGI servlet bridge we are using.

Thanks, Clemens

Am Mi., 16. Dez. 2020 um 09:17 Uhr schrieb Clemens Eisserer <linuxhippy@xxxxxxxxx>:
Hello,

I am currently a bit puzzled by a piece of code which broke by relying on HttpServletRequest.getParameter(String paramName) returning an empty String for parameters without a value - what happens on a recent Jetty is getParameter returns null instead.
Upon further investigation I found the cause is two values are actually parsed and returned by getParameterValues [null, ""]) and the first (null) is returned by getParameter.
E.g. for the Query String "?param1=value1&param2=value2&param3=" getParameterValues("param3") returns [null, ""] and getParameter("param3") returns null.

What is the rationale behind getParameterValues returning two values?
Has this behaviour changed "recently" and could somebody please give me a pointer to the specification?

Thanks a lot and best regards, Clemens


Back to the top