Announcement Announcement Module
Collapse
No announcement yet.
make setCacheSeconds to work Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • make setCacheSeconds to work

    Hi,
    I created a simple controller extends from AbstractController. Bellow is my implementation. The caches doesn't seem to work at all.

    Please help

    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
    throws Exception {

    this.setCacheSeconds(10);
    DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
    String now = dateFormat.format(new Date());
    logger.info("returning hello view with " + now);

    Map<String, Object> myModel = new HashMap<String, Object>();
    myModel.put("now", now);
    myModel.put("products", this.productManager.getProducts());

    return new ModelAndView("hello", "model", myModel);
    }
Working...
X