Project Wonder 5.0

er.extensions.appserver
Class ERXRequest

java.lang.Object
  extended by com.webobjects.appserver.WOMessage
      extended by com.webobjects.appserver.WORequest
          extended by er.extensions.appserver.ERXRequest
All Implemented Interfaces:
com.webobjects.foundation.NSKeyValueCoding, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCodingAdditions, java.lang.Cloneable

public class ERXRequest
extends com.webobjects.appserver.WORequest

Subclass of WORequest that fixes several Bugs. The ID's are #2924761 and #2961017. It can also be extended to handle #2957558 ("de-at" is converted to "German" instead of "German_Austria"). The request is created via ERXApplication#createRequest(String,String,String, NSDictionary,NSData,NSDictionary).


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
com.webobjects.foundation.NSKeyValueCodingAdditions.DefaultImplementation, com.webobjects.foundation.NSKeyValueCodingAdditions.Utility
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding
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.Null, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor
 
Field Summary
protected  ERXBrowser _browser
          holds a reference to the browser object
protected  com.webobjects.foundation.NSArray<java.lang.String> _browserLanguages
          NSArray to keep browserLanguages in.
protected  boolean _secureDisabled
          Specifies whether https should be overridden to be enabled or disabled app-wide.
protected static com.webobjects.foundation.NSArray<java.lang.String> HOST_ADDRESS_KEYS
           
protected static com.webobjects.foundation.NSArray<java.lang.String> HOST_NAME_KEYS
           
protected static java.lang.Boolean isBrowserFormValueEncodingOverrideEnabled
           
static org.apache.log4j.Logger log
          logging support
static java.lang.String UNKNOWN_HOST
           
static java.lang.String X_FORWARDED_PROTO_FOR_SSL
           
 
Fields inherited from class com.webobjects.appserver.WORequest
_IsmapCoords, ContextIDKey, DataKey, InstanceKey, PageNameKey, SenderIDKey, SessionIDKey, SingleInstanceID, SingleInstanceIDString
 
Fields inherited from class com.webobjects.appserver.WOMessage
_content, _contentData, _contentEncoding, _cookies, _headers, _httpVersion, _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, TheDefaultResponseEncoding
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling
_CLASS
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
NullValue
 
Constructor Summary
ERXRequest(java.lang.String string, java.lang.String string0, java.lang.String string1, com.webobjects.foundation.NSDictionary nsdictionary, com.webobjects.foundation.NSData nsdata, com.webobjects.foundation.NSDictionary nsdictionary2)
          Simply call superclass constructor
 
Method Summary
 void _completeURLPrefix(java.lang.StringBuffer stringbuffer, boolean secure, int port)
           
protected  java.lang.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.
 ERXBrowser browser()
          Gets the ERXBrowser associated with the user-agent of the request.
 com.webobjects.foundation.NSArray<java.lang.String> browserLanguages()
          Returns a cooked version of the languages the user has set in his Browser.
 com.webobjects.appserver.WOContext context()
           
 com.webobjects.foundation.NSDictionary cookieValues()
          Overridden because malformed cookie to return an empty dictionary if the super implementation throws an exception.
 void finalize()
          Cleaning up retian count on the browser.
protected  com.webobjects.foundation.NSArray<java.lang.String> fixAbbreviationArray(com.webobjects.foundation.NSArray<java.lang.String> languages)
           
 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.
 com.webobjects.foundation.NSMutableDictionary<java.lang.String,java.lang.Object> mutableUserInfo()
           
 java.lang.String remoteHost()
          Deprecated. Use remoteHostAddress() instead
 java.lang.String remoteHostAddress()
          Returns the remote client host address.
 java.lang.String remoteHostName()
          Returns the remote client host name.
 void setCredentials(java.lang.String userName, java.lang.String password)
          Utility method to set credentials for basic authorization.
 java.lang.String stringFormValueForKey(java.lang.String key)
           
 
Methods inherited from class com.webobjects.appserver.WORequest
_contentLengthHeader, _context, _formValueKeyEnumerator, _formValues, _hasFormValues, _lookForIDsInCookiesFirst, _multipartIterator, _originatingAddress, _originatingPort, _remoteAddress, _serverName, _serverPort, _setApplicationNumber, _setContext, _setIsUsingWebServer, _setOriginatingAddress, _setOriginatingPort, _uriDecomposed, adaptorPrefix, applicationName, applicationNumber, applicationURLPrefix, clone, contentInputStream, cookies, cookieValueForKey, cookieValuesForKey, dateFormValueForKey, defaultFormValueEncoding, formValueEncoding, formValueForKey, formValueKeys, formValues, formValuesForKey, isFormValueEncodingDetectionEnabled, isFromClientComponent, isMultipartFormData, isUsingWebServer, method, multipartIterator, numericFormValueForKey, queryString, requestHandlerKey, requestHandlerPath, requestHandlerPathArray, sessionID, setDefaultFormValueEncoding, setFormValueEncodingDetectionEnabled, toString, uri
 
Methods inherited from class com.webobjects.appserver.WOMessage
_appendContentAsciiString, _contentLength, _finalizeCookies, _initCookies, _setHeader, _setHeaders, _stringByEscapingString, addCookie, appendContentCharacter, appendContentData, appendContentDOMDocumentFragment, appendContentHTMLAttributeValue, appendContentHTMLString, appendContentString, appendHeader, appendHeaders, canAccessFieldsDirectly, content, contentAsDOMDocument, contentEncoding, contentString, defaultEncoding, defaultURLEncoding, equals, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, headerForKey, headerKeys, headers, headersForKey, httpVersion, removeCookie, removeHeadersForKey, requiresHTMLEscaping, setContent, setContent, setContent, setContentDOMDocument, setContentEncoding, setDefaultEncoding, setDefaultURLEncoding, setHeader, setHeaders, setHeaders, setHTTPVersion, setUserInfo, stringByEscapingHTMLAttributeValue, stringByEscapingHTMLString, takeValueForKey, takeValueForKeyPath, unableToSetNullForKey, userInfo, valueForKey, valueForKeyPath
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Logger log
logging support


UNKNOWN_HOST

public static final java.lang.String UNKNOWN_HOST
See Also:
Constant Field Values

X_FORWARDED_PROTO_FOR_SSL

public static final java.lang.String X_FORWARDED_PROTO_FOR_SSL

isBrowserFormValueEncodingOverrideEnabled

protected static java.lang.Boolean isBrowserFormValueEncodingOverrideEnabled

HOST_ADDRESS_KEYS

protected static final com.webobjects.foundation.NSArray<java.lang.String> HOST_ADDRESS_KEYS

HOST_NAME_KEYS

protected static final com.webobjects.foundation.NSArray<java.lang.String> HOST_NAME_KEYS

_browserLanguages

protected com.webobjects.foundation.NSArray<java.lang.String> _browserLanguages
NSArray to keep browserLanguages in.


_browser

protected ERXBrowser _browser
holds a reference to the browser object


_secureDisabled

protected boolean _secureDisabled
Specifies whether https should be overridden to be enabled or disabled app-wide. This is useful if you are developing with DirectConnect and you want to be able to specif secure forms and links, but you want to be able to continue testing them without setting up SSL. Defaults to false, set er.extensions.ERXRequest.secureDisabled=true to turn it off.

Constructor Detail

ERXRequest

public ERXRequest(java.lang.String string,
                  java.lang.String string0,
                  java.lang.String string1,
                  com.webobjects.foundation.NSDictionary nsdictionary,
                  com.webobjects.foundation.NSData nsdata,
                  com.webobjects.foundation.NSDictionary nsdictionary2)
Simply call superclass constructor

Method Detail

_isSecureDisabled

public static boolean _isSecureDisabled()
Returns true if er.extensions.ERXRequest.secureDisabled is true.

Returns:
true if er.extensions.ERXRequest.secureDisabled is true

isSecureDisabled

public boolean isSecureDisabled()
Returns true if er.extensions.ERXRequest.secureDisabled is true.

Returns:
true if er.extensions.ERXRequest.secureDisabled is true

isBrowserFormValueEncodingOverrideEnabled

public boolean isBrowserFormValueEncodingOverrideEnabled()

context

public com.webobjects.appserver.WOContext context()

browserLanguages

public com.webobjects.foundation.NSArray<java.lang.String> browserLanguages()
Returns a cooked version of the languages the user has set in his Browser. Adds "Nonlocalized" and ERXLocalizer#defaultLanguage() if not already present. Transforms regionalized en_us to English_US as a key.

Overrides:
browserLanguages in class com.webobjects.appserver.WORequest
Returns:
cooked version of user's languages

stringFormValueForKey

public java.lang.String stringFormValueForKey(java.lang.String key)
Overrides:
stringFormValueForKey in class com.webobjects.appserver.WORequest

browser

public ERXBrowser browser()
Gets the ERXBrowser associated with the user-agent of the request.

Returns:
browser object for the request

finalize

public void finalize()
              throws java.lang.Throwable
Cleaning up retian count on the browser.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

isSecure

public boolean isSecure()
Returns whether or not this request is secure.

Returns:
whether or not this request is secure

_completeURLPrefix

public void _completeURLPrefix(java.lang.StringBuffer stringbuffer,
                               boolean secure,
                               int port)
Overrides:
_completeURLPrefix in class com.webobjects.appserver.WORequest

isRequestSecure

public static boolean isRequestSecure(com.webobjects.appserver.WORequest request)
Returns whether or not the given request is secure. MS: I found this somewhere else a while ago, but I have no idea where or I'd give attribution.

Parameters:
request - the request to check
Returns:
whether or not the given request is secure.

fixAbbreviationArray

protected com.webobjects.foundation.NSArray<java.lang.String> fixAbbreviationArray(com.webobjects.foundation.NSArray<java.lang.String> languages)

cookieValues

public com.webobjects.foundation.NSDictionary cookieValues()
Overridden because malformed cookie to return an empty dictionary if the super implementation throws an exception. This will happen if the request contains malformed cookie values.

Overrides:
cookieValues in class com.webobjects.appserver.WORequest

isSessionIDInRequest

public 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. Will now return false if the request handler is streaming.

Overrides:
isSessionIDInRequest in class com.webobjects.appserver.WORequest

_getSessionIDFromValuesOrCookie

protected java.lang.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. Will now look for the session ID only in the cookie values.

Overrides:
_getSessionIDFromValuesOrCookie in class com.webobjects.appserver.WORequest

setCredentials

public void setCredentials(java.lang.String userName,
                           java.lang.String password)
Utility method to set credentials for basic authorization.


remoteHost

@Deprecated
public java.lang.String remoteHost()
Deprecated. Use remoteHostAddress() instead


remoteHostAddress

public java.lang.String remoteHostAddress()
Returns the remote client host address. Works in various setups, like direct connect, deployed etc. If no host name can be found, returns "UNKNOWN".

Returns:
remote client host address

remoteHostName

public java.lang.String remoteHostName()
Returns the remote client host name. If no host name can be found, returns "UNKNOWN".

Returns:
remote client host name

mutableUserInfo

public com.webobjects.foundation.NSMutableDictionary<java.lang.String,java.lang.Object> mutableUserInfo()

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.