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.HttpRequestHandler; 23 import org.springframework.web.servlet.HandlerAdapter; 24 import org.springframework.web.servlet.ModelAndView; 25 26 40 public class HttpRequestHandlerAdapter implements HandlerAdapter { 41 42 public boolean supports(Object handler) { 43 return (handler instanceof HttpRequestHandler); 44 } 45 46 public ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler) 47 throws Exception { 48 49 ((HttpRequestHandler) handler).handleRequest(request, response); 50 return null; 51 } 52 53 public long getLastModified(HttpServletRequest request, Object handler) { 54 if (handler instanceof LastModified) { 55 return ((LastModified) handler).getLastModified(request); 56 } 57 return -1L; 58 } 59 60 } 61 | Popular Tags |