2009年9月11日星期五

java.lang.IllegalStateException STREAMED

request.getInputStream() 和 request.getReader()不能同时调用,否则会引发java.lang.IllegalStateException异常。

API中有写:

getInputStreampublic getInputStream() throws java.io.IOException
Retrieves the body of the request as binary data using a . Either this method or may be called to read the body, not both.
Returns:
a object containing the body of the request
Throws:
java.lang.IllegalStateException - if the method has already been called for this request
java.io.IOException - if an input or output exception occurred

没有评论:

发表评论