diff --git a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/handler/DispatcherServletWebRequest.java b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/handler/DispatcherServletWebRequest.java index 0364a3bf90..d20beb1dc2 100644 --- a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/handler/DispatcherServletWebRequest.java +++ b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/handler/DispatcherServletWebRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,8 @@ package org.springframework.web.servlet.handler; import java.util.Locale; - import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import org.springframework.web.context.request.ServletWebRequest; import org.springframework.web.servlet.support.RequestContextUtils; @@ -44,6 +44,15 @@ public class DispatcherServletWebRequest extends ServletWebRequest { super(request); } + /** + * Create a new DispatcherServletWebRequest instance for the given request and response. + * @param request current HTTP request + * @param request current HTTP response + */ + public DispatcherServletWebRequest(HttpServletRequest request, HttpServletResponse response) { + super(request, response); + } + @Override public Locale getLocale() { return RequestContextUtils.getLocale(getRequest()); diff --git a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/handler/WebRequestHandlerInterceptorAdapter.java b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/handler/WebRequestHandlerInterceptorAdapter.java index 1fe0976d27..50eb0e2054 100644 --- a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/handler/WebRequestHandlerInterceptorAdapter.java +++ b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/handler/WebRequestHandlerInterceptorAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,21 +51,21 @@ public class WebRequestHandlerInterceptorAdapter implements HandlerInterceptor { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { - this.requestInterceptor.preHandle(new DispatcherServletWebRequest(request)); + this.requestInterceptor.preHandle(new DispatcherServletWebRequest(request, response)); return true; } public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { - this.requestInterceptor.postHandle(new DispatcherServletWebRequest(request), + this.requestInterceptor.postHandle(new DispatcherServletWebRequest(request, response), (modelAndView != null && !modelAndView.wasCleared() ? modelAndView.getModelMap() : null)); } public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { - this.requestInterceptor.afterCompletion(new DispatcherServletWebRequest(request), ex); + this.requestInterceptor.afterCompletion(new DispatcherServletWebRequest(request, response), ex); } }