juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Bognar <jamesbog...@apache.org>
Subject null vs empty on headers/query/form-data fields.
Date Mon, 22 May 2017 18:43:19 GMT
So I'm struggling a bit on how to handle null vs empty fields on headers,
queries, and form-data fields.  I'm leaning towards the following rule:

   - A null value on a header, query, or form-data is equivalent to not
   setting that value at all.

So if you try to add a query parameter foo=null, the foo parameter will not
be added at all.  Empty strings however (foo="") do get added.

@Header/@Query/@FormData will not add a value if the value is null.
@HeaderIfNE/@QueryIfNE/@FormDataIfNE will not add a value if the value is
null or empty.

One wrinkle is the value of the query parameter that has no value:  "&foo".

If you call getParameter("foo") on WebSphere Application Server, you get an
empty string.
If you call getParameter("foo") on Jetty, you get null.

I think we should treat "&foo" and "&foo=" as synonymous, and
getParameter("foo") should return an empty string.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message