Given the following HTML in a Java EE environment:
<input name="foo" value="hello" />
I would expect ServletRequest.getParameterNames()
would include foo
.
However given for example:
<footag name="foo" value="hello"/>
I would hopefully expect ServletRequest.getParameterNames()
to include foo
but it doesn't. This leads me to ponder:
ServletRequest
accepts the value from the input tag but not my custom tag?ServletRequest
accepts for parameter binding?After further investigation into this it turns out that it was in fact the browser that was not sending form parameter. According to the HTML5 specification:
Submittable elements:
Denotes elements that can be used for constructing the form data set when a form element is submitted.
button, input, keygen, object, select, textarea
It seems that only these tags should supply posted data. So it was not the RequestServlet
that is causing the problem.