有没有设置form的enctype属性? 默认的是application/x- www-form-urlencoded,如果你使用了request.getParameter() ,再用request.getInputStream()就获取不到了。流只能获取一次。
3.1.1 When Parameters Are Available The following are the conditions that mustbe met before post form data will be populated to the parameter set: 1. The request is an HTTP or HTTPS request. 2. The HTTP method is POST. 3. The content type is application/x-www-form-urlencoded. 4. The servlet has made an initial call of any of the getParameterfamily of methods on the request object. If the conditions are not met and the post form data is not included in the parameter set, the post data must still be available to the servlet via the request object’s input stream. If the conditions are met, post form data will no longer be available for reading directly from the request object’s input stream.
81,122
社区成员
341,744
社区内容
加载中
试试用AI创作助手写篇文章吧