KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > web > servlet > handler > DispatcherServletWebRequest


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.springframework.web.servlet.handler;
18
19 import java.util.Locale JavaDoc;
20
21 import javax.servlet.http.HttpServletRequest JavaDoc;
22
23 import org.springframework.web.context.request.ServletWebRequest;
24 import org.springframework.web.servlet.support.RequestContextUtils;
25
26 /**
27  * ServletWebRequest that is aware of DispatcherServlet's request context,
28  * such as the Locale determined by a LocaleResolver.
29  *
30  * @author Juergen Hoeller
31  * @since 2.0
32  * @see #getLocale()
33  * @see org.springframework.web.servlet.LocaleResolver
34  */

35 public class DispatcherServletWebRequest extends ServletWebRequest {
36
37     /**
38      * Create a new DispatcherServletWebRequest instance for the given request.
39      * @param request current HTTP request
40      */

41     public DispatcherServletWebRequest(HttpServletRequest JavaDoc request) {
42         super(request);
43     }
44
45     public Locale JavaDoc getLocale() {
46         return RequestContextUtils.getLocale(getRequest());
47     }
48
49 }
50
Popular Tags