(no commit message)
[utils] / wicket / components / src / main / java / org / wamblee / wicket / behavior / DisableCachingBehavior.java
index ec85de478a57863b1916ad667eacc06310479544..d6ff4d0f619b1e40b409a6e6243a97db4427860e 100644 (file)
@@ -19,16 +19,26 @@ import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.protocol.http.WebResponse;
 
 /**
+ * <p>
  * Behavior to disable browser caching. This also means that the page 
  * automatically expires the first time after it is rendered. 
+ * </p>
+ * 
+ * <p>
+ * Important: To make sure that form data cannot be submitted twice for
+ * the same data using the back button, it is still necessary to explicitly call 
+ * <code>getPage().getPageMap().remove(getPage());</code>
+ * in the <code>onSubmit</code> callback of the form. 
+ * </p>
  * 
  * @author Erik Brakkee
  * 
  */
-public class DisableCachingBehavior extends AbstractPageBehavior {
+public class DisableCachingBehavior extends ExpirePageImmediatelyBehavior {
 
     @Override
     public void setHeaders(WebPage aPage, WebResponse aResponse) {
+        System.out.println("Disabling caching for " + aPage.getClass().getName());
         aResponse.setHeader("Pragma", "no-cache");
         aResponse.setHeader("Cache-Control",
             "no-cache, max-age=0, must-revalidate, no-store");