我收到以下错误:java.lang.IllegalStateException:在使用 Struts2 实现 JSON 时,已经为此请求调用了 getInputStream()。例外:
org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException:
java.lang.reflect.InvocationTargetException
org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:230)
org.apache.struts2.json.JSONWriter.process(JSONWriter.java:160)
org.apache.struts2.json.JSONWriter.value(JSONWriter.java:126)
org.apache.struts2.json.JSONWriter.write(JSONWriter.java:94)
org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:115)
org.apache.struts2.json.JSONResult.createJSONString(JSONResult.java:197)
org.apache.struts2.json.JSONResult.execute(JSONResult.java:170)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:374)
...........
java.lang.IllegalStateException: getInputStream() has already been called for this request
org.apache.catalina.connector.Request.getReader(Request.java:1242)
org.apache.catalina.connector.RequestFacade.getReader(RequestFacade.java:506)
javax.servlet.ServletRequestWrapper.getReader(ServletRequestWrapper.java:212)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:210)
org.apache.struts2.json.JSONWriter.process(JSONWriter.java:160)
org.apache.struts2.json.JSONWriter.value(JSONWriter.java:126)
org.apache.struts2.json.JSONWriter.add(JSONWriter.java:355)
org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:215)
org.apache.struts2.json.JSONWriter.process(JSONWriter.java:160)
org.apache.struts2.json.JSONWriter.value(JSONWriter.java:126)
org.apache.struts2.json.JSONWriter.write(JSONWriter.java:94)
org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:115)
org.apache.struts2.json.JSONResult.createJSONString(JSONResult.java:197)
org.apache.struts2.json.JSONResult.execute(JSONResult.java:170)
.........
请帮我解决这个错误,因为我遇到了这个问题我有几个问题:我已经实现了 ServletRequestAware 并使用它来获取 userLocale。它是否与 JSONWriter 对象冲突。