【发布时间】:2014-05-22 13:39:57
【问题描述】:
我不断从任何带有 APPLICATION_FORM_URLENCODED 表单数据的 POST 操作中收到这些警告消息:
A servlet request to the URI (local request URI) contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
我已将其追溯到 org.glassfish.jersey.servlet.WebComponent:
if (!form.asMap().isEmpty()) {
containerRequest.setProperty(InternalServerProperties.FORM_DECODED_PROPERTY, form);
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.log(Level.WARNING, LocalizationMessages.FORM_PARAM_CONSUMED(containerRequest.getRequestUri()));
}
}
所以,如果有任何表单数据,它总是会打印这个警告。我是否做错了什么,因为用正常操作的警告填充日志似乎不是一个好主意。
【问题讨论】:
标签: java glassfish jersey jersey-2.0