java技術研究

          統計

          留言簿(3)

          閱讀排行榜

          評論排行榜

          oscache

          1、public boolean isCacheable(ServletRequest request) {
          boolean cachable = false;
          if (getTime() > 0) {
          /**
          * some AJAX application use post to get the page, need to specify a
          * cache=true parameter to enable cache. Known url includes:
          */
          if ("true".equals(request.getParameter("cache"))) {
          cachable = true;
          } else if (request.getParameter("noCache") == null
          && (request instanceof HttpServletRequest)) {
          HttpServletRequest req = (HttpServletRequest) request;
          String uri = req.getRequestURI();
          String contextPath = req.getContextPath();
          if(contextPath.length()>0)
          uri = uri.substring(contextPath.length());
          cachable = this.isCacheUris(uri);
          }
          }
          return cachable;
          }
          public void setCacheUris(List<String> cacheUris) {
          this.cacheUris = cacheUris;
          }
          private boolean isCacheUris(String uri){
          for(String _uri:cacheUris){
          if(uri.equals(_uri)){
          return true;
          }
          }
          return false;
          }



          2、<bean id="cacheFilterBean" class="com.ebizer.framework.core.filter.CacheFilter">
          <property name="cacheUris">
            <list>
              <value>/trend.html</value>
            </list>
            </property>
          </bean>

          posted on 2012-06-08 17:05 小秦 閱讀(234) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 巨鹿县| 香格里拉县| 报价| 苏州市| 靖远县| 志丹县| 昌乐县| 石楼县| 宝丰县| 苍南县| 靖远县| 泾川县| 聂荣县| 尚志市| 张家港市| 剑川县| 琼结县| 雷山县| 改则县| 万州区| 资兴市| 方城县| 云和县| 余江县| 高青县| 昭平县| 景谷| 叙永县| 葫芦岛市| 林周县| 虹口区| 瓮安县| 定襄县| 大关县| 焉耆| 内丘县| 岳阳县| 云浮市| 贵德县| 会昌县| 凤城市|