看起来restlet框架已经调用
getRequestEntityStream()了Request对象,而该对象又被调用
getInputStream(),因此
getReader()对请求的调用将抛出
IllegalStateException。用于getReader()和getInputStream()的Servlet
API文档说:
public java.io.BufferedReader getReader() ... ...Throws: java.lang.IllegalStateException - if getInputStream() method has been called on this request public ServletInputStream getInputStream() ... ... Throws: java.lang.IllegalStateException - if the getReader() method has already been called for this request
从文档看来,我们不能同时对Request对象调用getReader()和getInputStream()。我建议您使用
getInputStream()而不是
getReader()包装。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)