Top Description Methods
org.springframework.web.context.request

public Interface NativeWebRequest

extends WebRequest
Known Direct Subinterfaces
org.springframework.web.context.request.async.AsyncWebRequest
Known Direct Implementers
org.springframework.web.context.request.ServletWebRequest, org.springframework.web.context.request.FacesWebRequest
Imports
org.springframework.lang.Nullable

Extension of the WebRequest interface, exposing the native request and response objects in a generic fashion.

Mainly intended for framework-internal usage, in particular for generic argument resolution code.

Author
Juergen Hoeller
Since
2.5.2

Method Summary

Modifier and TypeMethod and Description
public Object
getNativeRequest()

Return the underlying native request object.

public <T> T

Returns:

the matching request object, or null if none of that type is available
getNativeRequest
(Class<T>
the desired type of request object
requiredType
)

Return the underlying native request object, if available.

public Object
getNativeResponse()

Return the underlying native response object, if any.

public <T> T

Returns:

the matching response object, or null if none of that type is available
getNativeResponse
(Class<T>
the desired type of response object
requiredType
)

Return the underlying native response object, if available.

Inherited from org.springframework.web.context.request.WebRequest:
checkNotModifiedcheckNotModifiedcheckNotModifiedgetContextPathgetDescriptiongetHeadergetHeaderNamesgetHeaderValuesgetLocalegetParametergetParameterMapgetParameterNamesgetParameterValuesgetRemoteUsergetUserPrincipalisSecureisUserInRole

Method Detail

getNativeRequestback to summary
public Object getNativeRequest()

Return the underlying native request object.

See Also
jakarta.servlet.http.HttpServletRequest
getNativeRequestback to summary
public <T> T getNativeRequest(Class<T> requiredType)

Return the underlying native request object, if available.

Parameters
requiredType:Class<T>

the desired type of request object

Returns:T

the matching request object, or null if none of that type is available

Annotations
@Nullable
See Also
jakarta.servlet.http.HttpServletRequest
getNativeResponseback to summary
public Object getNativeResponse()

Return the underlying native response object, if any.

Annotations
@Nullable
See Also
jakarta.servlet.http.HttpServletResponse
getNativeResponseback to summary
public <T> T getNativeResponse(Class<T> requiredType)

Return the underlying native response object, if available.

Parameters
requiredType:Class<T>

the desired type of response object

Returns:T

the matching response object, or null if none of that type is available

Annotations
@Nullable
See Also
jakarta.servlet.http.HttpServletResponse