Project Wonder 5.0.0.8654

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:
NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, Cloneable

public class ERXRequest
extends 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
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Field Summary
protected  ERXBrowser _browser
          holds a reference to the browser object
protected  NSArray<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 NSArray<String> HOST_ADDRESS_KEYS
           
protected static NSArray<String> HOST_NAME_KEYS
           
protected static Boolean isBrowserFormValueEncodingOverrideEnabled
           
static Logger log
          logging support
static String UNKNOWN_HOST
           
 
Fields inherited from class com.webobjects.appserver.WORequest
_finishedParsingMultipartFormData, _firstFormValueInvocation, _formValues, _IsmapCoords, _legacyMultipart, _method, _multipartIterator, _uri, ApplicationInstanceKey, ContextIDKey, DataKey, InstanceKey, PageNameKey, SenderIDKey, ServerPortHeader, ServerPortHeaderX, ServerPortSecureValue, SessionIDKey, SingleInstanceID, SingleInstanceIDString
 
Fields inherited from class com.webobjects.appserver.WOMessage
_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
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling
_CLASS
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
 
Constructor Summary
ERXRequest(String string, String string0, String string1, NSDictionary nsdictionary, NSData nsdata, NSDictionary nsdictionary2)
          Simply call superclass constructor
 
Method Summary
 void _completeURLPrefix(StringBuffer stringbuffer, boolean secure, int port)
           
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.
 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.
 WOContext context()
           
 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  NSArray<String> fixAbbreviationArray(NSArray<String> languages)
           
 boolean isBrowserFormValueEncodingOverrideEnabled()
           
static boolean isRequestSecure(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 mutableUserInfo()
           
 String remoteHost()
          Deprecated. Use remoteHostAddress() instead
 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)
           
 
Methods inherited from class com.webobjects.appserver.WORequest
_acceptingAddress, _acceptingPort, _contentLengthHeader, _context, _formValueKeyEnumerator, _formValues, _hasFormValues, _lookForIDsInCookiesFirst, _multipartIterator, _originatingAddress, _originatingPort, _remoteAddress, _serverName, _serverPort, _setAcceptingAddress, _setAcceptingPort, _setApplicationNumber, _setContext, _setIsUsingWebServer, _setOriginatingAdaptor, _setOriginatingAddress, _setOriginatingPort, _uriDecomposed, adaptorPrefix, ajaxFormSubmitKey, applicationName, applicationNumber, applicationURLPrefix, clone, contentInputStream, contentType, cookies, cookieValueForKey, cookieValuesForKey, dateFormValueForKey, 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
 
Methods inherited from class com.webobjects.appserver.WOMessage
_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
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static final Logger log
logging support


UNKNOWN_HOST

public static final String UNKNOWN_HOST
See Also:
Constant Field Values

isBrowserFormValueEncodingOverrideEnabled

protected static Boolean isBrowserFormValueEncodingOverrideEnabled

HOST_ADDRESS_KEYS

protected static final NSArray<String> HOST_ADDRESS_KEYS

HOST_NAME_KEYS

protected static final NSArray<String> HOST_NAME_KEYS

_browserLanguages

protected NSArray<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(String string,
                  String string0,
                  String string1,
                  NSDictionary nsdictionary,
                  NSData nsdata,
                  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 WOContext context()
Overrides:
context in class WORequest

browserLanguages

public NSArray<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 WORequest
Returns:
cooked version of user's languages

stringFormValueForKey

public String stringFormValueForKey(String key)
Overrides:
stringFormValueForKey in class 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 Throwable
Cleaning up retian count on the browser.

Overrides:
finalize in class Object
Throws:
Throwable

isSecure

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

Overrides:
isSecure in class WORequest
Returns:
whether or not this request is secure

_completeURLPrefix

public void _completeURLPrefix(StringBuffer stringbuffer,
                               boolean secure,
                               int port)
Overrides:
_completeURLPrefix in class WORequest

isRequestSecure

public static boolean isRequestSecure(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 NSArray<String> fixAbbreviationArray(NSArray<String> languages)

cookieValues

public 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 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 WORequest

_getSessionIDFromValuesOrCookie

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

Overrides:
_getSessionIDFromValuesOrCookie in class WORequest

setCredentials

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


remoteHost

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


remoteHostAddress

public 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 String remoteHostName()
Returns the remote client host name. If no host name can be found, returns "UNKNOWN".

Returns:
remote client host name

mutableUserInfo

public NSMutableDictionary mutableUserInfo()

Last updated: Thu, Nov 20, 2008 • 04:36 AM EST

Copyright © 2002 – 2007 Project Wonder.