This tag forces the cache to be flushed. If a key is specified, only the entry with that key is flushed. If no key is specified, the entire cache is flushed.
The following table describes attributes for the flush tag. The left column lists the attribute name, the middle column indicates the default value, and the right column describes what the attribute does.
Table 5–4 flush Attributes
Attribute |
Default |
Description |
---|---|---|
key |
servletPath_suffix |
(Optional) The name used by the container to access the cached entry. The cache key is added to the servlet path to generate a key to access the cached entry. If no key is specified, a number is generated according to the position of the tag in the page. |
scope |
application |
Specifies the scope of the cache. Valid values are request, session, and application. |
To flush the entry with key="foobar":
<mypfx:flush key="foobar"/> |
To flush the entire cache:
<% if (session != null && session.getAttribute("clearCache") != null) { %/> <mypfx:flush /> <% } %/> |