public class ERXRequest
extends com.webobjects.appserver.WORequest
ERXApplication.createRequest(String, String, String, Map, NSData, Map)
.com.webobjects.foundation.NSKeyValueCodingAdditions.DefaultImplementation, com.webobjects.foundation.NSKeyValueCodingAdditions.Utility
com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.MapImplementation, com.webobjects.foundation.NSKeyValueCoding.Null<T>, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor
Modifier and Type | Field and Description |
---|---|
protected ERXBrowser |
_browser
holds a reference to the browser object
|
protected NSArray<String> |
_browserLanguages
NSArray to keep browserLanguages in.
|
protected NSDictionary<String,NSArray<String>> |
_cookieDictionary
Holds the cookies in a NSDictionary.
|
protected boolean |
_secureDisabled
Specifies whether https should be overridden to be enabled or disabled app-wide.
|
protected static NSArray<String> |
HOST_ADDRESS_KEYS |
protected static NSArray<String> |
HOST_NAME_KEYS |
protected static Boolean |
isBrowserFormValueEncodingOverrideEnabled |
static String |
UNKNOWN_HOST |
static String |
X_FORWARDED_PROTO_FOR_SSL |
static String |
X_FORWARDED_PROTO_HEADER_KEY_FOR_SSL |
_finishedParsingMultipartFormData, _firstFormValueInvocation, _formValues, _IsmapCoords, _legacyMultipart, _method, _multipartIterator, _uri, ApplicationInstanceKey, ContextIDKey, DataKey, InstanceKey, PageNameKey, SenderIDKey, ServerPortHeader, ServerPortHeaderX, ServerPortSecureValue, SessionIDKey, SingleInstanceID, SingleInstanceIDString
_content, _contentData, _contentEncoding, _cookies, _headerEncoding, _httpHeaders, _httpVersion, _storePageInBacktrackCache, _TheCookieKey, _TheSetCookieKey, _userInfo, HTTP_STATUS_FORBIDDEN, HTTP_STATUS_FOUND, HTTP_STATUS_INTERNAL_ERROR, HTTP_STATUS_MOVED_PERMANENTLY, HTTP_STATUS_NO_CONTENT, HTTP_STATUS_NOT_FOUND, HTTP_STATUS_OK, map, TheDefaultResponseEncoding
Constructor and Description |
---|
ERXRequest(String aMethod,
String aURL,
String anHTTPVersion,
Map someHeaders,
com.webobjects.foundation.NSData aContent,
Map aUserInfoDictionary)
Returns a ERXRequest object initialized with the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
_completeURLPrefix(StringBuffer stringbuffer)
Add the protocol, server and port parts of this request to a StringBuffer.
|
void |
_completeURLPrefix(StringBuffer stringbuffer,
boolean secure,
int port)
Add the protocol, server and port parts to a StringBuffer to build an URL to this app.
|
protected String |
_getSessionIDFromValuesOrCookie(boolean inCookiesFirst)
Overridden because the super implementation would pull in all
content even if the request is supposed to be streaming and thus
very large.
|
static boolean |
_isSecureDisabled()
Returns
true if er.extensions.ERXRequest.secureDisabled is true. |
String |
_serverName()
This method is used by WOContext when generating full URLs for form actions in secure mode, etc.
|
ERXBrowser |
browser()
Gets the ERXBrowser associated with the user-agent of
the request.
|
NSArray<String> |
browserLanguages()
Returns a cooked version of the languages the user has set in his Browser.
|
com.webobjects.appserver.WOContext |
context() |
NSDictionary |
cookieValues()
Overridden to call _cookieDictionary() where we parse the cookies one
at a time using java.net.HttpCookie so that we don't get an empty cookie
dictionary if one cookie is malformed.
|
com.webobjects.foundation.NSTimestamp |
dateFormValueForKey(String aKey,
SimpleDateFormat dateFormatter) |
void |
finalize()
Cleaning up retain count on the browser.
|
protected NSArray<String> |
fixAbbreviationArray(NSArray<String> languages)
Translates ("de", "en-us;q=0.33", "en", "en-gb;q=0.66") to ("de", "en_gb", "en-us", "en").
|
boolean |
isBrowserFormValueEncodingOverrideEnabled() |
static boolean |
isRequestSecure(com.webobjects.appserver.WORequest request)
Returns whether or not the given request is secure.
|
boolean |
isSecure()
Returns whether or not this request is secure.
|
boolean |
isSecureDisabled()
Returns
true if er.extensions.ERXRequest.secureDisabled is true. |
boolean |
isSessionIDInRequest()
Overridden because the super implementation would pull in all
content even if the request is supposed to be streaming and thus
very large.
|
NSMutableDictionary<String,Object> |
mutableUserInfo() |
String |
remoteHostAddress()
Returns the remote client host address.
|
String |
remoteHostName()
Returns the remote client host name.
|
void |
setCredentials(String userName,
String password)
Utility method to set credentials for basic authorization.
|
String |
stringFormValueForKey(String key) |
_acceptingAddress, _acceptingPort, _contentLengthHeader, _context, _formValueKeyEnumerator, _formValues, _hasFormValues, _lookForIDsInCookiesFirst, _multipartIterator, _originatingAddress, _originatingPort, _remoteAddress, _serverPort, _setAcceptingAddress, _setAcceptingPort, _setApplicationNumber, _setContext, _setIsUsingWebServer, _setOriginatingAdaptor, _setOriginatingAddress, _setOriginatingPort, _uriDecomposed, adaptorPrefix, ajaxFormSubmitKey, applicationName, applicationNumber, applicationURLPrefix, clone, contentInputStream, contentType, cookies, cookieValueForKey, cookieValuesForKey, dateFormValueForKey, defaultFormValueEncoding, detectFormValuesEncoding, formValueEncoding, formValueForKey, formValueKeys, formValues, formValuesForKey, getFormValuesFromMultipartFormData, getFormValuesFromURLEncoding, isAjaxSubmit, isFormValueEncodingDetectionEnabled, isFromClientComponent, isMultipartFormData, isRequestFromFormSubmission, isUsingWebServer, isWhitespaceOrNull, method, multipartIterator, numericFormValueForKey, originatingAdaptor, queryString, removeCRLF, requestHandlerKey, requestHandlerPath, requestHandlerPathArray, sessionID, setAjaxFormSubmitKey, setContext, setDefaultFormValueEncoding, setFormValueEncoding, setFormValueEncodingDetectionEnabled, toString, uri, useLegacyMultipart
_appendContentAsciiString, _contentLength, _finalizeCookies, _initCookies, _setHeaders, _stringByEscapingString, addCookie, appendContentCharacter, appendContentData, appendContentDOMDocumentFragment, appendContentHTMLAttributeValue, appendContentHTMLString, appendContentString, appendHeader, appendHeaders, canAccessFieldsDirectly, content, contentAsDOMDocument, contentEncoding, contentString, defaultEncoding, defaultHeaderEncoding, defaultURLEncoding, equals, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasHeaderForKey, headerForKey, headerForKey, headerKeys, headers, headersForKey, httpVersion, removeCookie, removeHeadersForKey, requiresHTMLEscaping, setContent, setContent, setContent, setContent, setContentDOMDocument, setContentEncoding, setDefaultEncoding, setDefaultHeaderEncoding, setDefaultURLEncoding, setHeader, setHeaders, setHeaders, setHTTPVersion, setStorePageInBacktrackCache, setUserInfo, setUserInfoForKey, storePageInBacktrackCache, stringByEscapingHTMLAttributeValue, stringByEscapingHTMLString, takeValueForKey, takeValueForKeyPath, unableToSetNullForKey, userInfo, userInfoForKey, valueForKey, valueForKeyPath
public static final String UNKNOWN_HOST
public static final String X_FORWARDED_PROTO_FOR_SSL
public static final String X_FORWARDED_PROTO_HEADER_KEY_FOR_SSL
protected static Boolean isBrowserFormValueEncodingOverrideEnabled
protected ERXBrowser _browser
protected boolean _secureDisabled
false
, set er.extensions.ERXRequest.secureDisabled=true to turn it off.protected NSDictionary<String,NSArray<String>> _cookieDictionary
public ERXRequest(String aMethod, String aURL, String anHTTPVersion, Map someHeaders, com.webobjects.foundation.NSData aContent, Map aUserInfoDictionary)
aMethod
- a "GET", "POST" or "HEAD", may not be null
. If null
, or not one of the allowed methods, an IllegalArgumentException will be thrownaURL
- a URL, may not be null or an IllegalArgumentException will be thrownanHTTPVersion
- the version of HTTP used when sending the message, may not be null
or an IllegalArgumentException will be thrownsomeHeaders
- a dictionary whose String keys correspond to header names and whose values are arrays of one or more strings corresponding to the values of each headeraContent
- the HTML contentaUserInfoDictionary
- java.util.Map that contains any information that the WORequest object wants to pass along to other objectspublic String _serverName()
_serverName
in class com.webobjects.appserver.WORequest
WORequest._serverName()
,
WOContext.completeURLWithRequestHandlerKey(String, String, String, String, boolean, int)
,
WORequest._completeURLPrefix(StringBuffer, boolean, int)
public static boolean _isSecureDisabled()
true
if er.extensions.ERXRequest.secureDisabled is true.
Defaults to false
.true
if er.extensions.ERXRequest.secureDisabled is truepublic boolean isSecureDisabled()
true
if er.extensions.ERXRequest.secureDisabled is true.true
if er.extensions.ERXRequest.secureDisabled is truepublic boolean isBrowserFormValueEncodingOverrideEnabled()
public com.webobjects.appserver.WOContext context()
context
in class com.webobjects.appserver.WORequest
public NSArray<String> browserLanguages()
ERXLocalizer.defaultLanguage()
if not
already present. Transforms regionalized en_us to English_US as a key.browserLanguages
in class com.webobjects.appserver.WORequest
public String stringFormValueForKey(String key)
stringFormValueForKey
in class com.webobjects.appserver.WORequest
public com.webobjects.foundation.NSTimestamp dateFormValueForKey(String aKey, SimpleDateFormat dateFormatter)
dateFormValueForKey
in class com.webobjects.appserver.WORequest
public ERXBrowser browser()
public void finalize() throws Throwable
public boolean isSecure()
isSecure
in class com.webobjects.appserver.WORequest
public void _completeURLPrefix(StringBuffer stringbuffer)
stringbuffer
- public void _completeURLPrefix(StringBuffer stringbuffer, boolean secure, int port)
_completeURLPrefix
in class com.webobjects.appserver.WORequest
stringbuffer
- secure
- generate a https urlport
- the port number to use, 0 this request portpublic static boolean isRequestSecure(com.webobjects.appserver.WORequest request)
request
- the request to checkprotected NSArray<String> fixAbbreviationArray(NSArray<String> languages)
languages
- NSArray of Stringspublic NSDictionary cookieValues()
cookieValues
in class com.webobjects.appserver.WORequest
public boolean isSessionIDInRequest()
false
if the request
handler is streaming.isSessionIDInRequest
in class com.webobjects.appserver.WORequest
true
if the session ID can be obtained from the form values or a cookie.protected String _getSessionIDFromValuesOrCookie(boolean inCookiesFirst)
_getSessionIDFromValuesOrCookie
in class com.webobjects.appserver.WORequest
inCookiesFirst
- define if session ID should be searched first in cookiepublic void setCredentials(String userName, String password)
userName
- the user namepassword
- the passwordpublic String remoteHostAddress()
public String remoteHostName()
public NSMutableDictionary<String,Object> mutableUserInfo()
Copyright © 2002 – 2020 Project Wonder.