1 package de.juplo.accelerator.examples.spring;
3 import de.juplo.accelerator.annotations.CacheSeconds;
4 import de.juplo.accelerator.annotations.Cacheable;
5 import de.juplo.accelerator.annotations.LastModified;
6 import javax.servlet.http.HttpServletRequest;
7 import org.springframework.stereotype.Controller;
8 import org.springframework.web.bind.annotation.RequestMapping;
9 import org.springframework.web.servlet.ModelAndView;
13 * Simple Spring-MVC Controller
17 @Cacheable(eager=true)
18 public class FaultyController
20 public static final String ACCESS_TIME = FaultyController.class.getCanonicalName() + ".ACCESS_TIME";
21 public static final Integer DEFAULT_MAX_AGE = 60;
23 private final static long lastModified = System.currentTimeMillis();
26 public int cacheSeconds(HttpServletRequest request) {
27 return DEFAULT_MAX_AGE;
31 public long lastModified(HttpServletRequest request) {
35 @RequestMapping("/faulty-controller.html")
36 public ModelAndView process(HttpServletRequest request)
38 throw new RuntimeException("Oh, no!");