Class TLcdHttpServletRequestKVPRequestWrapper
- All Implemented Interfaces:
ILcdRequest
HttpServletRequest objects.-
Constructor Summary
ConstructorsConstructorDescriptionTLcdHttpServletRequestKVPRequestWrapper(jakarta.servlet.http.HttpServletRequest aHttpServletRequest) Creates a wrapper object for KVP requests. -
Method Summary
Modifier and TypeMethodDescriptionDelegates to the corresponding method inHttpServletRequest.getAttribute(String aAttributeName) Delegates to the corresponding method inHttpServletRequest.Delegates to the corresponding method inHttpServletRequest.Returns the MIME type of the body of the request, ornullif the type is not known.Delegates to the corresponding method inHttpServletRequest.longgetDateHeader(String aName) Returns the value of the specified request header as a long value that represents a Date object.Returns the value of the specified request header as a String.Returns an enumeration of all the header names this request contains.getHeaders(String aName) Returns all the values of the specified request header as an Enumeration of String objects.jakarta.servlet.http.HttpServletRequestReturns the body of the request as an input stream.intgetIntHeader(String aName) Returns the value of the specified request header as an int.getParameter(String aParameterName) Returns the value of the parameter with the given name.getParameterIgnoreCase(String aParameterName) A case-insensitive version ofgetParameter().Returns an unmodifiable list containing the names of all the parameters that are specified in this request.Delegates to the corresponding method inHttpServletRequest.Delegates to the corresponding method inHttpServletRequest.Delegates to the corresponding method inHttpServletRequest.intDelegates to the corresponding method inHttpServletRequest.Returns ajava.security.Principalobject containing the name of the current authenticated user.booleanisUserInRole(String aRole) Returns a boolean indicating whether the authenticated user is included in the specified logical "role".voidremoveAttribute(String aAttributeName) Delegates to the corresponding method inHttpServletRequest.voidsetAttribute(String aAttributeName, Object aAttributeObject) Delegates to the corresponding method inHttpServletRequest.
-
Constructor Details
-
TLcdHttpServletRequestKVPRequestWrapper
public TLcdHttpServletRequestKVPRequestWrapper(jakarta.servlet.http.HttpServletRequest aHttpServletRequest) Creates a wrapper object for KVP requests.- Parameters:
aHttpServletRequest- TheHttpServletRequestobject around which to build a wrapper.
-
-
Method Details
-
getParameter
Returns the value of the parameter with the given name. Only valid for KVP requests.- Specified by:
getParameterin interfaceILcdRequest- Parameters:
aParameterName- the parameter name- Returns:
- the value of the specified parameter or null if the parameter was not specified
-
getParameterNames
Returns an unmodifiable list containing the names of all the parameters that are specified in this request. Only valid for KVP requests.- Specified by:
getParameterNamesin interfaceILcdRequest- Returns:
- a list of parameter names.
-
getParameterIgnoreCase
A case-insensitive version ofgetParameter(). Only valid for KVP requests.- Specified by:
getParameterIgnoreCasein interfaceILcdRequest- Parameters:
aParameterName- the parameter name- Returns:
- the value of the specified parameter or null if the parameter was not specified
-
getProtocol
Delegates to the corresponding method inHttpServletRequest.- Specified by:
getProtocolin interfaceILcdRequest
-
getScheme
Delegates to the corresponding method inHttpServletRequest.- Specified by:
getSchemein interfaceILcdRequest
-
getServerName
Delegates to the corresponding method inHttpServletRequest.- Specified by:
getServerNamein interfaceILcdRequest
-
getServerPort
public int getServerPort()Delegates to the corresponding method inHttpServletRequest.- Specified by:
getServerPortin interfaceILcdRequest
-
getContextPath
Delegates to the corresponding method inHttpServletRequest.- Specified by:
getContextPathin interfaceILcdRequest
-
getApplicationPath
Delegates to the corresponding method inHttpServletRequest.- Specified by:
getApplicationPathin interfaceILcdRequest
-
getAttribute
Delegates to the corresponding method inHttpServletRequest.- Specified by:
getAttributein interfaceILcdRequest- Parameters:
aAttributeName- the name of the attribute.- Returns:
- the attribute value.
-
getAttributeNames
Delegates to the corresponding method inHttpServletRequest.- Specified by:
getAttributeNamesin interfaceILcdRequest- Returns:
- an
Enumerationof strings containing the names of the request's attributes
-
removeAttribute
Delegates to the corresponding method inHttpServletRequest.- Specified by:
removeAttributein interfaceILcdRequest- Parameters:
aAttributeName- the name of the attribute.
-
setAttribute
Delegates to the corresponding method inHttpServletRequest.- Specified by:
setAttributein interfaceILcdRequest- Parameters:
aAttributeName- the name of the attribute.aAttributeObject- the value of the attribute.
-
getHeader
Returns the value of the specified request header as a String. If the request did not include a header of the specified name, this method returns null. The header name is case insensitive. You can use this method with any request header.- Specified by:
getHeaderin interfaceILcdRequest- Parameters:
aName- a String specifying the header name- Returns:
- a String containing the value of the requested header, or null if the request does not have a header of that name
-
getHeaders
Returns all the values of the specified request header as an Enumeration of String objects.Some headers, such as
Accept-Languagecan be sent by clients as several headers each with a different value rather than sending the header as a comma separated list.If the request did not include any headers of the specified name, this method returns an empty Enumeration. The header name is case insensitive. You can use this method with any request header.
- Parameters:
aName- a String specifying the header name- Returns:
- an Enumeration containing the values of the requested header. If the request does not have any headers of that name return an empty enumeration. If the container does not allow access to header information, return null
-
getHeaderNames
Returns an enumeration of all the header names this request contains. If the request has no headers, this method returns an empty enumeration.Some servlet containers do not allow do not allow servlets to access headers using this method, in which case this method returns null
- Returns:
- an enumeration of all the header names sent with this request; if the request has no headers, an empty enumeration; if the servlet container does not allow servlets to use this method, null
-
getIntHeader
Returns the value of the specified request header as an int. If the request does not have a header of the specified name, this method returns -1. If the header cannot be converted to an integer, this method throws a NumberFormatException.The header name is case insensitive.
- Parameters:
aName- a String specifying the name of a request header- Returns:
- an integer expressing the value of the request header or -1 if the request doesn't have a header of this name
- Throws:
NumberFormatException- If the header value can't be converted to an int
-
getDateHeader
Returns the value of the specified request header as a long value that represents a Date object. Use this method with headers that contain dates, such asIf-Modified-Since.The date is returned as the number of milliseconds since January 1, 1970 GMT. The header name is case insensitive.
If the request did not have a header of the specified name, this method returns -1. If the header can't be converted to a date, the method throws an IllegalArgumentException.
- Specified by:
getDateHeaderin interfaceILcdRequest- Parameters:
aName- a String specifying the name of the header- Returns:
- a long value representing the date specified in the header expressed as the number of milliseconds since January 1, 1970 GMT, or -1 if the named header was not included with the reqest
- Throws:
IllegalArgumentException- If the header value can't be converted to a date
-
getUserPrincipal
Description copied from interface:ILcdRequestReturns ajava.security.Principalobject containing the name of the current authenticated user. If the user has not been authenticated, the method returnsnull.- Specified by:
getUserPrincipalin interfaceILcdRequest- Returns:
- a
java.security.Principalcontaining the name of the user making this request;nullif the user has not been authenticated - See Also:
-
isUserInRole
Description copied from interface:ILcdRequestReturns 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.- Specified by:
isUserInRolein interfaceILcdRequest- Parameters:
aRole- 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 - See Also:
-
getContentType
Description copied from interface:ILcdRequestReturns the MIME type of the body of the request, ornullif the type is not known.- Specified by:
getContentTypein interfaceILcdRequest- Returns:
- the
Stringwith the MIME type of the request, or null if the type is not known. - See Also:
-
getInputStream
Description copied from interface:ILcdRequestReturns the body of the request as an input stream. The returned input stream must support the methodInputStream.mark(int)and thus returntrueforInputStream.markSupported().This is important as the command dispatcher needs to take a peek into the request to determine which request handler knows to deal with the client request.
- Specified by:
getInputStreamin interfaceILcdRequest- Returns:
- the body of the request as an input stream.
- Throws:
IOException- if an input exception occurs.
-
getHttpServletRequest
public jakarta.servlet.http.HttpServletRequest getHttpServletRequest()
-