標籤:style http os io 使用 java ar strong for
Struts2.3+spring3+hibernate3開發
現在想在原有基礎上使用 oscache提高效能,使用中發現問題
例如:使用struts2標籤
<cache:cache time="60" scope="session">
<s:action name="ztree.action" executeResult="false"/>
</cache:cache>
其中 這個action功能是從資料庫讀取資料 報錯
WARN [http-8080-Processor5] ActionComponent:122 - Error while trying to flush writer
java.io.IOException: Illegal to flush within a custom tag
at javax.servlet.jsp.tagext.BodyContent.flush(BodyContent.java:79)
at com.opensymphony.webwork.components.ActionComponent.end(ActionComponent.java:120)
at com.opensymphony.webwork.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:21)
at org.apache.jsp.oscacheDemo_jsp._jspx_meth_ww_action_0(org.apache.jsp.oscacheDemo_jsp:232)
at org.apache.jsp.oscacheDemo_jsp._jspx_meth_cache_cache_0(org.apache.jsp.oscacheDemo_jsp:178)
但是資料一樣能取出來
在一分鐘內 重新整理該頁面 cache包含的部分不再執
其實設定下 參數 flush="false" 為false即可。
<cache:cache time="60" scope="session">
<s:action name="ztree.action" executeResult="false" flush="false"/>
</cache:cache>
OSCache報錯error while trying to flush writer