====== Cache Control ======
you can control the cache of JSP pages with extending [[http://kickjava.com/src/org/apache/struts/action/RequestProcessor.java.htm|RequestProcessor.class]]
protected void processContent(HttpServletRequest request, HttpServletResponse response) {
if (request.getServletPath().equals("/order/orderGear.do")){
logger.info( request.getServletPath() + " is CACHE ON!");
if (logger.isDebugEnabled()) {
logger.debug("CACHE ON");
}
response.setHeader("Cache-control", "Public, max-age:1800");
response.setHeader("Expires", "1");
response.setHeader("Pragma", "Cache");
} else {
logger.info( request.getServletPath() + " is CACHE OFF!");
if(logger.isDebugEnabled()) {
logger.debug("CACHE OFF");
}
response.setHeader("Cache-control", "No-cache");
response.setHeader("Expires", "0");
response.setHeader("Pragma", "No-cache");
return;
}
super.processContent(request, response);
}
{{keywords>cache control RequestProcessor Popup ActionMessage}}
===== reference =====
1.[[http://www.mnot.net/cache_docs/|Caching Tutorial for Web Authors and Webmasters]]
====== Popup ActionMessage ======
ActionMessageを画面にhtmlとして出力する代わりにPopup窓で出す方法を紹介する。
エラーを出したい場合はmessage属性をfalseで設定してproperty属性を指定すれば良い。\\
もしメッセージの中で選択的に出したいのなら次の行を加えることで簡単に解決。
~~DISCUSSION~~