[Opensymphony-oscache] How to implement write-thru caching with oscache?

Lars Torunski <[email protected]> Mon, 25 Jul 2005 00:26:15 CDT
Newsgroups gmane.comp.java.open-symphony.os-cache
Message-ID <17366561.1122269205726.JavaMail.os-j2ee@opensymphony01.contegix.com>
Cache the page fragment with the jsp tags:

<cache:cache key="jsp1.reports.Database" time="-1" group="group.reports.Database">

<%
ArrayList result = display.showTable();
%>

<TABLE BORDER=2>
<%
for(int i=0; i<result.size(); i++) {
out.println(((StringBuffer)result.get(i)).toString());
}
%>
</TABLE>

</cache:cache>



and in jsp2 if a user inputs data just flush the group

<cache:flush scope="application" group="group.reports.Database" />

or the key

<cache:flush key="jsp1.reports.Database" />

---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=4658&messageID=11295#11295