1 16 17 package org.springframework.web.servlet.mvc; 18 19 import javax.servlet.http.HttpServletRequest ; 20 import javax.servlet.http.HttpServletResponse ; 21 22 import org.springframework.web.servlet.HandlerAdapter; 23 import org.springframework.web.servlet.ModelAndView; 24 25 39 public class SimpleControllerHandlerAdapter implements HandlerAdapter { 40 41 public boolean supports(Object handler) { 42 return (handler instanceof Controller); 43 } 44 45 public ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler) 46 throws Exception { 47 48 return ((Controller) handler).handleRequest(request, response); 49 } 50 51 public long getLastModified(HttpServletRequest request, Object handler) { 52 if (handler instanceof LastModified) { 53 return ((LastModified) handler).getLastModified(request); 54 } 55 return -1L; 56 } 57 58 } 59 | Popular Tags |