Author: wesw
Date: Thu Feb 14 16:31:23 2008
New Revision: 627920
URL: http://svn.apache.org/viewvc?rev=627920&view=rev
Log:
fixes IllegalStateException when running with Jetty 6.1.6, addresses WW-2350
Modified:
struts/struts2/trunk/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java
Modified:
struts/struts2/trunk/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java?rev=627920&r1=627919&r2=627920&view=diff
==============================================================================
---
struts/struts2/trunk/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java
(original)
+++
struts/struts2/trunk/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java
Thu Feb 14 16:31:23 2008
@@ -20,6 +20,10 @@
*/
package org.apache.struts2.rest;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
@@ -57,7 +61,9 @@
}
if (request.getContentLength() > 0) {
- handler.toObject(request.getReader(), target);
+ InputStream is = (InputStream) request.getInputStream();
+ InputStreamReader reader = new InputStreamReader(is);
+ handler.toObject((Reader) reader, target);
}
return invocation.invoke();
}