java.lang.Object
org.apache.wicket.request.Request
org.apache.wicket.request.http.WebRequest
- Direct Known Subclasses:
MockWebRequest
,ServletWebRequest
Base class for request that provides additional web-related information.
- Author:
- Matej Knopp, Igor Vaynberg
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
marker for Ajax requestsstatic final String
marker for Ajax-relative urlstatic final String
Origin
http headerstatic final String
Referer
http headerstatic final String
marker for Ajax requestsstatic final String
marker for Ajax-relative urlstatic final String
anti-cache query parameter added by Wicket.Ajax.Request at its URL -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncloneWithUrl
(Url url) Returns request with specified URL and same POST parameters as this request.jakarta.servlet.http.Cookie
abstract List<jakarta.servlet.http.Cookie>
abstract Instant
getDateHeader
(String name) Returns the value of the specified request header as along
value that represents aDate
object.abstract String
Returns the value of the specified request header as aString
getHeaders
(String name) Returns all the values of the specified request header.final Instant
Convenience method for retrieving If-Modified-Since header.boolean
isAjax()
Returns whether this request is an Ajax request.boolean
Signals whether or not request processing should preserve the current client url - in other words, handle this request without redirecting.Methods inherited from class org.apache.wicket.request.Request
getCharset, getClientUrl, getContainerRequest, getContextPath, getFilterPath, getLocale, getOriginalUrl, getPostParameters, getPrefixToContextPath, getQueryParameters, getRequestParameters, getUrl
-
Field Details
-
PARAM_AJAX
marker for Ajax requests- See Also:
-
HEADER_AJAX
marker for Ajax requests- See Also:
-
PARAM_AJAX_BASE_URL
marker for Ajax-relative url- See Also:
-
HEADER_AJAX_BASE_URL
marker for Ajax-relative url- See Also:
-
PARAM_AJAX_REQUEST_ANTI_CACHE
anti-cache query parameter added by Wicket.Ajax.Request at its URL- See Also:
-
HEADER_ORIGIN
Origin
http header- See Also:
-
HEADER_REFERER
Referer
http header- See Also:
-
-
Constructor Details
-
WebRequest
public WebRequest()
-
-
Method Details
-
getCookies
- Returns:
- request cookies
-
getCookie
- Parameters:
cookieName
-- Returns:
- cookie with specified name or
null
if the cookie does not exist
-
getHeaders
Returns all the values of the specified request header.- Parameters:
name
-- Returns:
- unmodifiable list of header values
-
getHeader
Returns the value of the specified request header as aString
- Parameters:
name
-- Returns:
- string value of request header
-
getDateHeader
Returns the value of the specified request header as along
value that represents aDate
object. Use this method with headers that contain dates, such asIf-Modified-Since
.- Parameters:
name
-- Returns:
- date value of request header or
null
if not found
-
getIfModifiedSinceHeader
Convenience method for retrieving If-Modified-Since header.- Returns:
- date representing the header or
null
if not set
-
isAjax
Returns whether this request is an Ajax request. This implementation checks for values of "wicket-ajax" url parameter or the "Wicket-Ajax" header. Subclasses can use other approaches.- Returns:
true
if this request is an ajax request,false
otherwise.
-
shouldPreserveClientUrl
Signals whether or not request processing should preserve the current client url - in other words, handle this request without redirecting. By default, this method returnsfalse
. For example, this method can be used to preserve the url that caused a 404 in the browser if Wicket is also responsible for rendering the 404 page. If this method returns the default value offalse
then Wicket will redirect to the bookmarkable url of the error page, instead of preserving the url that caused the 404 in the browser.- Returns:
true
if current client url should be preserved
-
cloneWithUrl
Returns request with specified URL and same POST parameters as this request.- Overrides:
cloneWithUrl
in classRequest
- Parameters:
url
- Url instance- Returns:
- request with specified URL.
-