Interface IRequestWebScopeWithoutResponse
-
- All Superinterfaces:
com.helger.datetime.domain.IHasCreationDateTime,com.helger.commons.id.IHasID<String>,com.helger.scope.IRequestScope,com.helger.scope.IScope,IWebScope
- All Known Subinterfaces:
IRequestWebScope
- All Known Implementing Classes:
RequestWebScope,RequestWebScopeMultipart
public interface IRequestWebScopeWithoutResponse extends com.helger.scope.IRequestScope, IWebScope
Interface for a single web request scope object that does not offer access to the HTTP response.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleanareCookiesEnabled()Check if this request uses a Cookie based session handling (meaning cookies are enabled) or whether the session ID needs to be appended to a URL.default com.helger.commons.url.ISimpleURLencodeRedirectURL(com.helger.commons.url.ISimpleURL aURL)Encodes the specified URL for use in thesendRedirectmethod or, if encoding is not needed, returns the URL unchanged.StringencodeRedirectURL(String sURL)Encodes the specified URL for use in thesendRedirectmethod or, if encoding is not needed, returns the URL unchanged.default com.helger.commons.url.ISimpleURLencodeURL(com.helger.commons.url.ISimpleURL aURL)Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.StringencodeURL(String sURL)Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.default StringgetAuthType()Returns the name of the authentication scheme used to protect the servlet.default com.helger.useragent.browser.BrowserInfogetBrowserInfo()default StringgetCharacterEncoding()Returns the name of the character encoding used in the body of this request.default CharsetgetCharset()default longgetContentLength()Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known.default StringgetContentType()Returns the MIME type of the body of the request, ornullif the type is not known.StringgetContextAndServletPath()StringgetContextPath()default jakarta.servlet.http.Cookie[]getCookies()Returns an array containing all of theCookieobjects the client sent with this request.StringgetFullContextAndServletPath()default StringgetFullContextPath()default StringgetFullServerPath()default com.helger.commons.http.EHttpMethodgetHttpMethod()default com.helger.http.EHttpVersiongetHttpVersion()default StringgetLocalAddr()Returns the Internet Protocol (IP) address of the interface on which the request was received.default StringgetLocalName()Returns the host name of the Internet Protocol (IP) interface on which the request was received.default intgetLocalPort()Returns the Internet Protocol (IP) port number of the interface on which the request was received.default StringgetMethod()Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.default StringgetPathInfo()Returns any extra path information associated with the URL the client sent when it made this request.default StringgetPathTranslated()Returns any extra path information after the servlet name but before the query string, and translates it to a real path.default StringgetPathWithinServlet()Return the path within the servlet mapping for the given request, i.e. the part of the request's URL beyond the part that called the servlet, or "" if the whole URL has been used to identify the servlet.default StringgetPathWithinServletContext()Return the URI of the request within the servlet context.default StringgetProtocol()Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1.default StringgetQueryString()Returns the query string that is contained in the request URL after the path.default StringgetRemoteAddr()Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.default StringgetRemoteHost()Returns the fully qualified name of the client or the last proxy that sent the request.default intgetRemotePort()Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.default StringgetRemoteUser()Returns the login of the user making this request, if the user has been authenticated, ornullif the user has not been authenticated.jakarta.servlet.http.HttpServletRequestgetRequest()com.helger.servlet.request.IRequestParamMapgetRequestParamMap()default StringgetRequestURIDecoded()Get the request URI without an eventually appended session (";jsessionid=...").
This method considers the GlobalWebScope custom context path.
This method returns the percent decoded parameters Examples of Returned Values First line of HTTP request Returned Value POST /some/pa%3Ath.html;JSESSIONID=4711 /some/pa:th.html GET http://foo.bar/a.html;JSESSIONID=4711 /a.html HEAD /xyz;JSESSIONID=4711?default StringgetRequestURIEncoded()Get the request URI without an eventually appended session (";jsessionid=...").
This method considers the GlobalWebScope custom context path.
This method returns the percent encoded parameters "as is" Examples of Returned Values First line of HTTP request Returned Value POST /some/pa%3Ath.html;JSESSIONID=4711 /some/pa%3Ath.html GET http://foo.bar/a.html;JSESSIONID=4711 /a.html HEAD /xyz;JSESSIONID=4711?default StringBuildergetRequestURLDecoded()Reconstructs the URL the client used to make the request.default StringBuildergetRequestURLEncoded()Reconstructs the URL the client used to make the request.default StringgetScheme()Returns the name of the scheme used to make this request, for example,http,https, orftp.default StringgetServerName()Returns the host name of the server to which the request was sent.default intgetServerPort()Returns the port number to which the request was sent.default StringgetServletPath()Returns the part of this request's URL that calls the servlet.default jakarta.servlet.http.HttpSessiongetSession(boolean bCreateIfNotExisting)Returns the currentHttpSessionassociated with this request or, if there is no current session andcreateis true, returns a new session.default StringgetSessionID(boolean bCreateIfNotExisting)default StringgetURIDecoded()Get the full URI (excl. protocol and host) and parameters of the current request.default StringgetURIEncoded()Get the full URI (excl. protocol and host) and parameters of the current request.default StringgetURLDecoded()Get the full URL (incl. protocol) and parameters of the current request.default StringgetURLEncoded()Get the full URL (incl. protocol) and parameters of the current request.default com.helger.useragent.IUserAgentgetUserAgent()Get the user agent object of this HTTP request.default PrincipalgetUserPrincipal()Returns ajava.security.Principalobject containing the name of the current authenticated user.com.helger.commons.http.HttpHeaderMapheaders()default booleanisRequestedSessionIdFromCookie()Checks whether the requested session ID came in as a cookie.default booleanisRequestedSessionIdFromURL()Checks whether the requested session ID came in as part of the request URL.default booleanisRequestedSessionIdValid()Checks whether the requested session ID is still valid.default booleanisSecure()Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.default booleanisUserInRole(String sRole)Returns a boolean indicating whether the authenticated user is included in the specified logical "role".IRequestParamContainerparams()-
Methods inherited from interface com.helger.datetime.domain.IHasCreationDateTime
getCreationDate, getCreationTime, hasCreationDateTime, isCreatedAt
-
Methods inherited from interface com.helger.scope.IScope
attrs, destroyScope, getAllScopeRenewalAwareAttributes, getID, initScope, isDestroyed, isInDestruction, isValid, runAtomic, runAtomic
-
Methods inherited from interface com.helger.web.scope.IWebScope
getCreationDateTime
-
-
-
-
Method Detail
-
headers
@Nonnull @ReturnsMutableObject com.helger.commons.http.HttpHeaderMap headers()
- Returns:
- A cached header map for this request. Never
null. Alterations to this map are visible everywhere. Clone the object if you need to modify it.
-
getUserAgent
@Nonnull default com.helger.useragent.IUserAgent getUserAgent()
Get the user agent object of this HTTP request.- Returns:
- A non-
nulluser agent object.
-
getBrowserInfo
@Nullable default com.helger.useragent.browser.BrowserInfo getBrowserInfo()
- Returns:
- The information about the matching browser or
nullif no known browser was detected.
-
params
@Nonnull @ReturnsMutableObject IRequestParamContainer params()
- Returns:
- The external URL parameters. Never
null.
-
getRequestParamMap
@Nonnull com.helger.servlet.request.IRequestParamMap getRequestParamMap()
- Returns:
- A cached request param map for this request. Never
null.
-
getSessionID
@Nullable default String getSessionID(boolean bCreateIfNotExisting)
- Specified by:
getSessionIDin interfacecom.helger.scope.IRequestScope
-
getCharacterEncoding
@Nullable default String getCharacterEncoding()
Returns the name of the character encoding used in the body of this request. This method returnsnullif the request does not specify a character encoding- Returns:
- a
Stringcontaining the name of the character encoding, ornullif the request does not specify a character encoding
-
getContentType
@Nullable default String getContentType()
Returns the MIME type of the body of the request, ornullif the type is not known. For HTTP servlets, same as the value of the CGI variable CONTENT_TYPE.- Returns:
- a
Stringcontaining the name of the MIME type of the request, or null if the type is not known
-
getContentLength
@CheckForSigned default long getContentLength()
Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known. For HTTP servlets, same as the value of the CGI variable CONTENT_LENGTH.- Returns:
- an integer containing the length of the request body or -1 if the length is not known
-
getCharset
@Nullable default Charset getCharset()
- Returns:
- The charset defined for this request. May be
nullif none is present;
-
getProtocol
default String getProtocol()
Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1. For HTTP servlets, the value returned is the same as the value of the CGI variableSERVER_PROTOCOL.- Returns:
- a
Stringcontaining the protocol name and version number
-
getHttpVersion
@Nullable default com.helger.http.EHttpVersion getHttpVersion()
- Returns:
- The
EHttpVersionof the request.
-
getScheme
default String getScheme()
Returns the name of the scheme used to make this request, for example,http,https, orftp. Different schemes have different rules for constructing URLs, as noted in RFC 1738.- Returns:
- a
Stringcontaining the name of the scheme used to make this request
-
getServerName
default String getServerName()
Returns the host name of the server to which the request was sent. It is the value of the part before ":" in theHostheader value, if any, or the resolved server name, or the server IP address.- Returns:
- a
Stringcontaining the name of the server
-
getServerPort
default int getServerPort()
Returns the port number to which the request was sent. It is the value of the part after ":" in theHostheader value, if any, or the server port where the client connection was accepted on.- Returns:
- an integer specifying the port number
-
getRemoteAddr
default String getRemoteAddr()
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request. For HTTP servlets, same as the value of the CGI variableREMOTE_ADDR.- Returns:
- a
Stringcontaining the IP address of the client that sent the request
-
getRemoteHost
default String getRemoteHost()
Returns the fully qualified name of the client or the last proxy that sent the request. If the engine cannot or chooses not to resolve the hostname (to improve performance), this method returns the dotted-string form of the IP address. For HTTP servlets, same as the value of the CGI variableREMOTE_HOST.- Returns:
- a
Stringcontaining the fully qualified name of the client
-
getRemotePort
default int getRemotePort()
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.- Returns:
- an integer specifying the port number
-
isSecure
default boolean isSecure()
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.- Returns:
- a boolean indicating if the request was made using a secure channel
-
getLocalName
default String getLocalName()
Returns the host name of the Internet Protocol (IP) interface on which the request was received.- Returns:
- a
Stringcontaining the host name of the IP on which the request was received.
-
getLocalAddr
default String getLocalAddr()
Returns the Internet Protocol (IP) address of the interface on which the request was received.- Returns:
- a
Stringcontaining the IP address on which the request was received.
-
getLocalPort
default int getLocalPort()
Returns the Internet Protocol (IP) port number of the interface on which the request was received.- Returns:
- an integer specifying the port number
-
getAuthType
default String getAuthType()
Returns the name of the authentication scheme used to protect the servlet. All servlet containers support basic, form and client certificate authentication, and may additionally support digest authentication. If the servlet is not authenticatednullis returned.Same as the value of the CGI variable AUTH_TYPE.
- Returns:
- one of the static members BASIC_AUTH, FORM_AUTH, CLIENT_CERT_AUTH,
DIGEST_AUTH (suitable for == comparison) or the container-specific
string indicating the authentication scheme, or
nullif the request was not authenticated.
-
getCookies
@Nullable default jakarta.servlet.http.Cookie[] getCookies()
Returns an array containing all of theCookieobjects the client sent with this request. This method returnsnullif no cookies were sent.- Returns:
- an array of all the
Cookiesincluded with this request, ornullif the request has no cookies
-
getMethod
default String getMethod()
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. Same as the value of the CGI variable REQUEST_METHOD.- Returns:
- a
Stringspecifying the name of the method with which this request was made
-
getHttpMethod
@Nullable default com.helger.commons.http.EHttpMethod getHttpMethod()
- Returns:
- The
EHttpMethodmatching thegetMethod()
-
getPathInfo
default String getPathInfo()
Returns any extra path information associated with the URL the client sent when it made this request. The extra path information follows the servlet path but precedes the query string and will start with a "/" character.This method returns
nullif there was no extra path information.Same as the value of the CGI variable PATH_INFO.
- Returns:
- a
String, decoded by the web container, specifying extra path information that comes after the servlet path but before the query string in the request URL; ornullif the URL does not have any extra path information
-
getPathTranslated
default String getPathTranslated()
Returns any extra path information after the servlet name but before the query string, and translates it to a real path. Same as the value of the CGI variable PATH_TRANSLATED.If the URL does not have any extra path information, this method returns
nullor the servlet container cannot translate the virtual path to a real path for any reason (such as when the web application is executed from an archive). The web container does not decode this string.- Returns:
- a
Stringspecifying the real path, ornullif the URL does not have any extra path information
-
getContextPath
@Nonnull String getContextPath()
- Returns:
- Returns the portion of the request URI that indicates the context
of the request. The context path always comes first in a request
URI. The path starts with a "/" character but does not end with a
"/" character. For servlets in the default (root) context, this
method returns "". The container does not decode this string. E.g.
/contextor an empty string for the root context. Never with a trailing slash. - See Also:
getFullContextPath()
-
getQueryString
default String getQueryString()
Returns the query string that is contained in the request URL after the path. This method returnsnullif the URL does not have a query string. Same as the value of the CGI variable QUERY_STRING.- Returns:
- a
Stringcontaining the query string ornullif the URL contains no query string. The value is not decoded by the container.
-
getRemoteUser
default String getRemoteUser()
Returns the login of the user making this request, if the user has been authenticated, ornullif the user has not been authenticated. Whether the user name is sent with each subsequent request depends on the browser and type of authentication. Same as the value of the CGI variable REMOTE_USER.- Returns:
- a
Stringspecifying the login of the user making this request, ornullif the user login is not known
-
isUserInRole
default boolean isUserInRole(String sRole)
Returns a boolean indicating whether the authenticated user is included in the specified logical "role". Roles and role membership can be defined using deployment descriptors. If the user has not been authenticated, the method returnsfalse.- Parameters:
sRole- aStringspecifying the name of the role- Returns:
- a
booleanindicating whether the user making this request belongs to a given role;falseif the user has not been authenticated
-
getUserPrincipal
@Nullable default Principal getUserPrincipal()
Returns ajava.security.Principalobject containing the name of the current authenticated user. If the user has not been authenticated, the method returnsnull.- Returns:
- a
java.security.Principalcontaining the name of the user making this request;nullif the user has not been authenticated
-
getRequestURIDecoded
@Nonnull default String getRequestURIDecoded()
Get the request URI without an eventually appended session (";jsessionid=...").
This method considers the GlobalWebScope custom context path.
This method returns the percent decoded parametersExamples of Returned Values First line of HTTP request Returned Value POST /some/pa%3Ath.html;JSESSIONID=4711 /some/pa:th.html GET http://foo.bar/a.html;JSESSIONID=4711 /a.html HEAD /xyz;JSESSIONID=4711?a=b /xyz - Returns:
- The request URI without the optional session ID. Never
null. - Since:
- 9.1.0
-
getRequestURIEncoded
@Nonnull default String getRequestURIEncoded()
Get the request URI without an eventually appended session (";jsessionid=...").
This method considers the GlobalWebScope custom context path.
This method returns the percent encoded parameters "as is"Examples of Returned Values First line of HTTP request Returned Value POST /some/pa%3Ath.html;JSESSIONID=4711 /some/pa%3Ath.html GET http://foo.bar/a.html;JSESSIONID=4711 /a.html HEAD /xyz;JSESSIONID=4711?a=b /xyz - Returns:
- The request URI without the optional session ID. Never
null. - Since:
- 9.1.0
-
getRequestURLDecoded
@Nonnull @Nonempty default StringBuilder getRequestURLDecoded()
Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.
This method returns the percent decoded parametersIf this request has been forwarded using
RequestDispatcher.forward(jakarta.servlet.ServletRequest, jakarta.servlet.ServletResponse), the server path in the reconstructed URL must reflect the path used to obtain the RequestDispatcher, and not the server path specified by the client.Because this method returns a
StringBuilder, not a string, you can modify the URL easily, for example, to append query parameters.This method is useful for creating redirect messages and for reporting errors.
- Returns:
- a
StringBuilderobject containing the reconstructed URL - Since:
- 9.1.10
-
getRequestURLEncoded
@Nonnull @Nonempty default StringBuilder getRequestURLEncoded()
Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.
This method returns the percent encoded parameters "as is"If this request has been forwarded using
RequestDispatcher.forward(jakarta.servlet.ServletRequest, jakarta.servlet.ServletResponse), the server path in the reconstructed URL must reflect the path used to obtain the RequestDispatcher, and not the server path specified by the client.Because this method returns a
StringBuilder, not a string, you can modify the URL easily, for example, to append query parameters.This method is useful for creating redirect messages and for reporting errors.
- Returns:
- a
StringBuilderobject containing the reconstructed URL - Since:
- 9.1.10
-
getServletPath
@Nonnull default String getServletPath()
Returns the part of this request's URL that calls the servlet. This path starts with a "/" character and includes either the servlet name or a path to the servlet, but does not include any extra path information or a query string. Same as the value of the CGI variable SCRIPT_NAME.This method will return an empty string ("") if the servlet used to process this request was matched using the "/*" pattern.
- Returns:
- a
Stringcontaining the name or path of the servlet being called, as specified in the request URL, decoded, or an empty string if the servlet used to process the request is matched using the "/*" pattern.
-
getSession
@Nullable default jakarta.servlet.http.HttpSession getSession(boolean bCreateIfNotExisting)
Returns the currentHttpSessionassociated with this request or, if there is no current session andcreateis true, returns a new session.If
bCreateIfNotExistingisfalseand the request has no validHttpSession, this method returnsnull.To make sure the session is properly maintained, you must call this method before the response is committed. If the container is using cookies to maintain session integrity and is asked to create a new session when the response is committed, an IllegalStateException is thrown.
- Parameters:
bCreateIfNotExisting-trueto create a new session for this request if necessary;falseto returnnullif there's no current session- Returns:
- the
HttpSessionassociated with this request ornullifbCreateIfNotExistingisfalseand the request has no valid session
-
isRequestedSessionIdValid
default boolean isRequestedSessionIdValid()
Checks whether the requested session ID is still valid.If the client did not specify any session ID, this method returns
false.- Returns:
trueif this request has an id for a valid session in the current session context;falseotherwise- See Also:
getSession(boolean)
-
isRequestedSessionIdFromCookie
default boolean isRequestedSessionIdFromCookie()
Checks whether the requested session ID came in as a cookie.- Returns:
trueif the session ID came in as a cookie; otherwise,false- See Also:
getSession(boolean)
-
isRequestedSessionIdFromURL
default boolean isRequestedSessionIdFromURL()
Checks whether the requested session ID came in as part of the request URL.- Returns:
trueif the session ID came in as part of a URL; otherwise,false- See Also:
getSession(boolean)
-
getFullServerPath
@Nonnull default String getFullServerPath()
- Returns:
- Return the absolute server path. E.g. "http://localhost:8080"
-
getFullContextPath
@Nonnull default String getFullContextPath()
- Returns:
- Return the absolute context path. E.g.
http://localhost:8080/context. Never with a trailing slash. - See Also:
getContextPath()
-
getContextAndServletPath
@Nonnull String getContextAndServletPath()
- Returns:
- Return the absolute servlet path. E.g.
/context/config.jspor/context/action/
-
getFullContextAndServletPath
@Nonnull String getFullContextAndServletPath()
- Returns:
- Return the absolute servlet path. E.g.
http://localhost:8080/context/config.jsporhttp://localhost:8080/context/action/
-
getURIDecoded
@Nonnull @Nonempty default String getURIDecoded()
Get the full URI (excl. protocol and host) and parameters of the current request.
/context/servlet/path/a/b?c=123&d=789- Returns:
- The full URI of the current request.
- Since:
- 9.1.10
-
getURIEncoded
@Nonnull @Nonempty default String getURIEncoded()
Get the full URI (excl. protocol and host) and parameters of the current request.
/context/servlet/path/a/b?c=123&d=789- Returns:
- The full URI of the current request.
- Since:
- 9.1.10
-
getURLDecoded
@Nonnull @Nonempty default String getURLDecoded()
Get the full URL (incl. protocol) and parameters of the current request.
http://hostname.com:81/context/servlet/path/a/b?c=123&d=789- Returns:
- The full URL of the current request.
- Since:
- 9.1.10
-
getURLEncoded
@Nonnull @Nonempty default String getURLEncoded()
Get the full URL (incl. protocol) and parameters of the current request.
http://hostname.com:81/context/servlet/path/a/b?c=123&d=789- Returns:
- The full URL of the current request.
- Since:
- 9.1.10
-
encodeURL
@Nonnull String encodeURL(@Nonnull String sURL)
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged. The implementation of this method includes the logic to determine whether the session ID needs to be encoded in the URL. For example, if the browser supports cookies, or session tracking is turned off, URL encoding is unnecessary.For robust session tracking, all URLs emitted by a servlet should be run through this method. Otherwise, URL rewriting cannot be used with browsers which do not support cookies.
- Parameters:
sURL- the url to be encoded. May not benull.- Returns:
- the encoded URL if encoding is needed; the unchanged URL otherwise.
-
encodeURL
@Nonnull default com.helger.commons.url.ISimpleURL encodeURL(@Nonnull com.helger.commons.url.ISimpleURL aURL)
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged. The implementation of this method includes the logic to determine whether the session ID needs to be encoded in the URL. For example, if the browser supports cookies, or session tracking is turned off, URL encoding is unnecessary.For robust session tracking, all URLs emitted by a servlet should be run through this method. Otherwise, URL rewriting cannot be used with browsers which do not support cookies.
- Parameters:
aURL- the url to be encoded. May not benull.- Returns:
- the encoded URL if encoding is needed. Never
null.
-
encodeRedirectURL
@Nonnull String encodeRedirectURL(@Nonnull String sURL)
Encodes the specified URL for use in thesendRedirectmethod or, if encoding is not needed, returns the URL unchanged. The implementation of this method includes the logic to determine whether the session ID needs to be encoded in the URL. Because the rules for making this determination can differ from those used to decide whether to encode a normal link, this method is separated from theencodeURLmethod.All URLs sent to the
HttpServletResponse.sendRedirectmethod should be run through this method. Otherwise, URL rewriting cannot be used with browsers which do not support cookies.- Parameters:
sURL- the url to be encoded.- Returns:
- the encoded URL if encoding is needed; the unchanged URL otherwise.
- See Also:
encodeURL(String)
-
encodeRedirectURL
@Nonnull default com.helger.commons.url.ISimpleURL encodeRedirectURL(@Nonnull com.helger.commons.url.ISimpleURL aURL)
Encodes the specified URL for use in thesendRedirectmethod or, if encoding is not needed, returns the URL unchanged. The implementation of this method includes the logic to determine whether the session ID needs to be encoded in the URL. Because the rules for making this determination can differ from those used to decide whether to encode a normal link, this method is separated from theencodeURLmethod.All URLs sent to the
HttpServletResponse.sendRedirectmethod should be run through this method. Otherwise, URL rewriting cannot be used with browsers which do not support cookies.- Parameters:
aURL- the url to be encoded. May not benull.- Returns:
- the encoded URL if encoding is needed. Never
null. - See Also:
encodeURL(String)
-
areCookiesEnabled
default boolean areCookiesEnabled()
Check if this request uses a Cookie based session handling (meaning cookies are enabled) or whether the session ID needs to be appended to a URL.- Returns:
trueif the session ID is passed via cookies.
-
getPathWithinServletContext
@Nonnull default String getPathWithinServletContext()
Return the URI of the request within the servlet context.- Returns:
- the path within the web application and never
null. By default "/" is returned is an empty request URI is determined.
-
getPathWithinServlet
@Nonnull default String getPathWithinServlet()
Return the path within the servlet mapping for the given request, i.e. the part of the request's URL beyond the part that called the servlet, or "" if the whole URL has been used to identify the servlet.
Detects include request URL if called within a RequestDispatcher include.
E.g.: servlet mapping = "/test/*"; request URI = "/test/a" -> "/a".
E.g.: servlet mapping = "/test"; request URI = "/test" -> "".
E.g.: servlet mapping = "/*.test"; request URI = "/a.test" -> "".- Returns:
- the path within the servlet mapping, or ""
-
getRequest
@Nonnull jakarta.servlet.http.HttpServletRequest getRequest()
- Returns:
- The underlying HTTP servlet request object. Never
null.
-
-