Using fields with the same name in a POST form allows to obtain request values right into a List<String>
variable:
<input name="colors" value="white">
<input name="colors" value="black">
Is there a similar idiomatic mechanism to handle key / value pairs?
I tried different random syntaxes in the name
attribute and none triggered the same magic as my previous example so I figured out I could always invent mine. However this:
<input name="colors[background]" value="white">
<input name="colors[foreground]" value="blacks">
... causes the field to be missing from javax.servlet.http.HttpServletRequest.getParameter()
:
// None work
request.getParameter("colors")
request.getParameter("colors[background]")
This suggests square brackets have a special meaning anyway, albeit not the one I expected.
How should I handle my Hash
variables? I'm using Jdeveloper 11g, WebLogic 10.3 and Jersey 1.17 in case there's an implementation extension not mandated by JAX-RS.