Package org.springframework.web.servlet.handler

# Class DispatcherServletWebRequest

java.lang.Object
org.springframework.web.context.request.AbstractRequestAttributes
org.springframework.web.context.request.ServletRequestAttributes
org.springframework.web.context.request.ServletWebRequest
org.springframework.web.servlet.handler.DispatcherServletWebRequest

All Implemented Interfaces:
  `org.springframework.web.context.request.NativeWebRequest`, `org.springframework.web.context.request.RequestAttributes`, `org.springframework.web.context.request.WebRequest`

public class DispatcherServletWebRequest extends org.springframework.web.context.request.ServletWebRequest
`ServletWebRequest` subclass that is aware of `DispatcherServlet`'s request context, such as the Locale determined by the configured `LocaleResolver`.

Since:
  2.0
Author:
  Juergen Hoeller
See Also:
  - `getLocale()`
  - `LocaleResolver`

## Field Summary

### Fields inherited from class org.springframework.web.context.request.ServletRequestAttributes

`DESTRUCTION_CALLBACK_NAME_PREFIX, immutableValueTypes`

### Fields inherited from class org.springframework.web.context.request.AbstractRequestAttributes

`requestDestructionCallbacks`

### Fields inherited from interface org.springframework.web.context.request.RequestAttributes

`REFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_REQUEST, SCOPE_SESSION`

## Constructor Summary

Constructors
Constructor
Description
`DispatcherServletWebRequest(HttpServletRequest request)`
Create a new DispatcherServletWebRequest instance for the given request.
`DispatcherServletWebRequest(HttpServletRequest request, HttpServletResponse response)`
Create a new DispatcherServletWebRequest instance for the given request and response.

## Method Summary

Modifier and Type
Method
Description
`Locale`
`getLocale()`

### Methods inherited from class org.springframework.web.context.request.ServletWebRequest

`checkNotModified, checkNotModified, checkNotModified, getContextPath, getDescription, getHeader, getHeaderNames, getHeaderValues, getHttpMethod, getNativeRequest, getNativeRequest, getNativeResponse, getNativeResponse, getParameter, getParameterMap, getParameterNames, getParameterValues, getRemoteUser, getUserPrincipal, isNotModified, isSecure, isUserInRole, toString`

### Methods inherited from class org.springframework.web.context.request.ServletRequestAttributes

`getAttribute, getAttributeNames, getRequest, getResponse, getSession, getSessionId, getSessionMutex, isImmutableSessionAttribute, registerDestructionCallback, registerSessionDestructionCallback, removeAttribute, resolveReference, setAttribute, updateAccessedSessionAttributes`

### Methods inherited from class org.springframework.web.context.request.AbstractRequestAttributes

`isRequestActive, registerRequestDestructionCallback, removeRequestDestructionCallback, requestCompleted`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.springframework.web.context.request.RequestAttributes

`getAttribute, getAttributeNames, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, resolveReference, setAttribute`

## Constructor Details

### DispatcherServletWebRequest

public DispatcherServletWebRequest(HttpServletRequest request)
Create a new DispatcherServletWebRequest instance for the given request.

Parameters:
  `request` - current HTTP request

### DispatcherServletWebRequest

public DispatcherServletWebRequest(HttpServletRequest request, HttpServletResponse response)
Create a new DispatcherServletWebRequest instance for the given request and response.

Parameters:
  `request` - current HTTP request
  `response` - current HTTP response

## Method Details

### getLocale

public Locale getLocale()

Specified by:
  `getLocale` in interface `org.springframework.web.context.request.WebRequest`
Overrides:
  `getLocale` in class `org.springframework.web.context.request.ServletWebRequest`