}
private void filterFormParameters(HttpServletRequest hsr, ContainerRequest cr) throws IOException {
if (MediaTypes.typeEquals(MediaType.APPLICATION_FORM_URLENCODED_TYPE, cr.getMediaType())
&& !isEntityPresent(cr)) {
Form f = new Form();
Enumeration e = hsr.getParameterNames();
while (e.hasMoreElements()) {
String name = (String) e.nextElement();
String[] values = hsr.getParameterValues(name);
f.put(name, Arrays.asList(values));
}
if (!f.isEmpty()) {
cr.getProperties().put(FormDispatchProvider.FORM_PROPERTY, f);
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.log(Level.WARNING,
"A servlet request, to the URI " + cr.getRequestUri() + ", " +
"contains form parameters in " +