1
2
3
4
5 package net.sf.wfnm.web;
6
7 import net.sf.wfnm.Config;
8
9 import javax.servlet.http.HttpServletResponse;
10
11
12 /***
13 * A factory helper for HttpServletResponse.
14 *
15 * @author <a href="mailto:malbari@users.sourceforge.net">Maurizio Albari</a>
16 * @version 1.0.6
17 */
18 public class ResponseFactory {
19 /***
20 * Add the 'no-cache' header directive
21 *
22 * @param response the http response
23 */
24 public static void addNoCacheHeaderDirective(HttpServletResponse response) {
25 if (Config.getInstance().isEnabled() && Config.getInstance().isNoCacheEnabled()) {
26 response.setHeader("Pragma", "No-cache");
27 response.setHeader("Cache-Control", "no-cache");
28 response.setDateHeader("Expires", 1);
29 }
30 }
31 }