public class ServletRequest extends H.Request
inputStream, reader| Constructor and Description |
|---|
ServletRequest(javax.servlet.http.HttpServletRequest req) |
| Modifier and Type | Method and Description |
|---|---|
protected Class |
_impl()
Returns the class of the implementation.
|
protected void |
_initCookieMap() |
protected String |
_ip()
Returns remote ip address.
|
String |
contextPath()
Returns the context path of the request.
|
InputStream |
createInputStream() |
String |
header(String name)
Returns the header content by name.
|
Iterable<String> |
headerNames()
Returns all header names presented in this request.
|
Iterable<String> |
headers(String name)
Returns all header content by name.
|
H.Method |
method()
Returns the HTTP method of the request
|
ServletRequest |
method(H.Method method)
Set the Http method on this request.
|
Iterable<String> |
paramNames()
Return all parameter names
|
String |
paramVal(String name)
Return a request parameter value by name.
|
String[] |
paramVals(String name)
Returns all values associated with the name specified in the http request.
|
String |
path()
Returns the path of the request.
|
String |
query()
Returns query string or an empty String if the request doesn’t contains a query string
|
boolean |
secure()
Check if the request was made on a secure channel
|
_setCookie, accept, accept, accept, characterEncoding, contentLength, contentType, context, context, cookie, cookies, current, current, domain, etag, etagMatches, fullPath, fullUrl, host, inputStream, ip, isAjax, isModified, locale, locales, me, password, port, rawAccept, reader, readerCreated, referer, referrer, scheme, toString, url, user, userAgent, userAgentStrprotected Class _impl()
H.RequestReturns the class of the implementation. Not to be used by application
public Iterable<String> headers(String name)
H.RequestReturns all header content by name. This method returns content of all header with the same name specified in an Iterable of String. If there is no header has the name specified, then an empty iterable is returned.
Note header name is case insensitive
public Iterable<String> headerNames()
H.RequestReturns all header names presented in this request.
headerNames in class H.RequestIterable of String.public String path()
H.RequestReturns the path of the request. This does not include the context path. The path is a composite of HttpServletRequest.getServletPath() and HttpServletRequest.getPathInfo()
The path starts with "/" but not end with "/"
public String contextPath()
H.RequestReturns the context path of the request. The context path starts with “/” but not end with “/”. If there is no context path then and empty "" is returned
contextPath in class H.Requestpublic String query()
H.RequestReturns query string or an empty String if the request doesn’t contains a query string
public boolean secure()
H.RequestCheck if the request was made on a secure channel
protected void _initCookieMap()
_initCookieMap in class H.Requestpublic String header(String name)
H.RequestReturns the header content by name. If there are multiple headers with the same name, then the first one is returned. If there is no header has the name then null is returned
Note header name is case insensitive
public H.Method method()
H.RequestReturns the HTTP method of the request
public ServletRequest method(H.Method method)
H.RequestSet the Http method on this request. Used by framework to “override” a HTTP method
public InputStream createInputStream() throws IllegalStateException
createInputStream in class H.RequestIllegalStateExceptionpublic String paramVal(String name)
H.RequestReturn a request parameter value by name. If there is no parameter found with the name specified, then null is returned. If there are multiple values associated with the name, then the first one is returned
public String[] paramVals(String name)
H.RequestReturns all values associated with the name specified in the http request. If there is no parameter found with the name, then new String[0] shall be returned
Copyright © 2017–2020 OSGL (Open Source General Library). All rights reserved.