net.wotonomy.web
Class WORequest

java.lang.Object
  extended by net.wotonomy.web.WOMessage
      extended by net.wotonomy.web.WOResponse
          extended by net.wotonomy.web.WORequest
All Implemented Interfaces:
WOActionResults

public class WORequest
extends WOResponse

A pure java implementation of WORequest. This implementation is backed by an HttpServletRequest, and thus does not support application-specific subclassing. Future implementations may remove this limitation.

Version:
$Revision: 905 $
Author:
michael@mpowers.net, $Author: cgruber $

Field Summary
 
Fields inherited from class net.wotonomy.web.WOResponse
defaultEncoding
 
Fields inherited from class net.wotonomy.web.WOMessage
_contentData, _contentEncoding, _cookies, _headers
 
Constructor Summary
WORequest()
          Parameterless constructor which should not be called.
WORequest(javax.servlet.http.HttpServletRequest aRequest, WOApplication anApplication)
          The only supported constructor for this implementation.
WORequest(java.lang.String aMethod, java.lang.String aURL, java.lang.String aProtocolName, net.wotonomy.foundation.NSDictionary headerMap, net.wotonomy.foundation.NSData aData, net.wotonomy.foundation.NSDictionary userInfo)
          Standard constructor.
 
Method Summary
 java.lang.String adaptorPrefix()
          Returns the portion of the URI specifying the engine within which this web application is running.
 java.lang.String applicationName()
          Returns the application name as specified in the request URI.
 int applicationNumber()
          Returns the id of the application instance that is needed to service this request.
 net.wotonomy.foundation.NSArray browserLanguages()
          Returns the client's preferred languages in decreasing order of preference.
 net.wotonomy.foundation.NSData content()
          Returns the content of the request, or null if no content.
 java.lang.String cookieValueForKey(java.lang.String aKey)
          Returns one value for the specified cookie key.
 net.wotonomy.foundation.NSDictionary cookieValues()
          Returns a dictionary of cookie key-value mappings.
 net.wotonomy.foundation.NSArray cookieValuesForKey(java.lang.String aKey)
          Returns an array of cookie values for the specified key in no particular order.
 java.lang.String defaultFormValueEncoding()
          Returns the default form value encoding ("ISO8859_1").
 int formValueEncoding()
          Gets the current method used for decoding form values.
 java.lang.Object formValueForKey(java.lang.String aKey)
          Returns one value for the specified key.
 net.wotonomy.foundation.NSArray formValueKeys()
          Returns an array containing all the form keys in the request.
 net.wotonomy.foundation.NSDictionary formValues()
          Returns a dictionary containing all the key-value mappings in the request.
 net.wotonomy.foundation.NSArray formValuesForKey(java.lang.String aKey)
          Returns an array of the values for the specified key in no particular order.
 java.lang.String headerForKey(java.lang.String aKey)
          Returns one value for the specified header key.
 net.wotonomy.foundation.NSArray headerKeys()
          Returns an array of the header names in this request in no particular order.
 net.wotonomy.foundation.NSArray headersForKey(java.lang.String aString)
          Returns an array of the header values for the specified key in no particular order.
 java.lang.String httpVersion()
          Returns the name of the protocol (presumably HTTP) and the version used by the client as sent in the request headers.
 boolean isFormValueEncodingDetectionEnabled()
          Gets whether the appropriate encoding scheme for decoding the form values is currently automatically determined.
 boolean isFromClientComponent()
          Returns whether the request is from a java-based client component.
 java.lang.String method()
          Returns the HTTP method of the request: "GET" or "POST", or possibly "PUT".
 java.lang.String requestHandlerKey()
          Returns the portion of the URI that specifies which request handler should handle the request.
 java.lang.String requestHandlerPath()
          Returns the portion of the URI that specifies path information for the request, not including the query string.
 net.wotonomy.foundation.NSArray requestHandlerPathArray()
          Returns the items in the request handler path parsed by the "/" delimiter and put into an array.
 java.lang.String sessionID()
          Returns the unique identifier for the sessions associated with this request, or null if no session is found.
 void setDefaultFormValueEncoding(java.lang.String encoding)
          Sets the default character encoding.
 void setFormValueEncodingDetectionEnabled(boolean enabled)
          Sets whether the appropriate encoding scheme for decoding the form values will be automatically determined.
 java.lang.String stringFormValueForKey(java.lang.String key)
          Returns the value for the specified key, as a String.
 java.lang.String uri()
          Returns the Uniform Resource Identifier, which is the part of the request URL after the protocol name (after the port number) and before the query parameters (before the question mark).
 net.wotonomy.foundation.NSDictionary userInfo()
          Returns the application-specific userInfo dictionary.
 
Methods inherited from class net.wotonomy.web.WOResponse
defaultEncoding, disableClientCaching, generateResponse, setDefaultEncoding, setStatus, status
 
Methods inherited from class net.wotonomy.web.WOMessage
addCookie, appendContentCharacter, appendContentData, appendContentHTMLAttributeValue, appendContentHTMLString, appendContentString, contentEncoding, cookies, removeCookie, setContent, setContentEncoding, setHeader, setHeaders, setHTTPVersion, setUserInfo, stringByEscapingHTMLAttributeValue, stringByEscapingHTMLString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WORequest

public WORequest()
Parameterless constructor which should not be called.


WORequest

public WORequest(java.lang.String aMethod,
                 java.lang.String aURL,
                 java.lang.String aProtocolName,
                 net.wotonomy.foundation.NSDictionary headerMap,
                 net.wotonomy.foundation.NSData aData,
                 net.wotonomy.foundation.NSDictionary userInfo)
Standard constructor. Method and URL are required. HeaderMap is a map of header names to arrays containing one or more values. Data is the content of the request. UserInfo contains application-defined paramters that get passed to all objects involved in dispatching the request.


WORequest

public WORequest(javax.servlet.http.HttpServletRequest aRequest,
                 WOApplication anApplication)
The only supported constructor for this implementation. This WORequest will wrap the specified servlet request.

Method Detail

method

public java.lang.String method()
Returns the HTTP method of the request: "GET" or "POST", or possibly "PUT".


uri

public java.lang.String uri()
Returns the Uniform Resource Identifier, which is the part of the request URL after the protocol name (after the port number) and before the query parameters (before the question mark).


httpVersion

public java.lang.String httpVersion()
Returns the name of the protocol (presumably HTTP) and the version used by the client as sent in the request headers.

Overrides:
httpVersion in class WOMessage

headerKeys

public net.wotonomy.foundation.NSArray headerKeys()
Returns an array of the header names in this request in no particular order.

Overrides:
headerKeys in class WOMessage

headersForKey

public net.wotonomy.foundation.NSArray headersForKey(java.lang.String aString)
Returns an array of the header values for the specified key in no particular order.

Overrides:
headersForKey in class WOMessage

headerForKey

public java.lang.String headerForKey(java.lang.String aKey)
Returns one value for the specified header key. Provided as a convenience since most headers have only one value. Returns null if not found.

Overrides:
headerForKey in class WOMessage

content

public net.wotonomy.foundation.NSData content()
Returns the content of the request, or null if no content. The type of the content is determined by the "content-type" header. On error, null is returned.

Overrides:
content in class WOMessage

userInfo

public net.wotonomy.foundation.NSDictionary userInfo()
Returns the application-specific userInfo dictionary. This implementation returns the servlet attribute map.

Overrides:
userInfo in class WOMessage

requestHandlerPathArray

public net.wotonomy.foundation.NSArray requestHandlerPathArray()
Returns the items in the request handler path parsed by the "/" delimiter and put into an array.


browserLanguages

public net.wotonomy.foundation.NSArray browserLanguages()
Returns the client's preferred languages in decreasing order of preference. The strings are returned in java Locale format, meaning dashes (-) are converted to underbars (_): see java.util.Locale.toString().


adaptorPrefix

public java.lang.String adaptorPrefix()
Returns the portion of the URI specifying the engine within which this web application is running. This is important for generating URLs to be used in the content of the response.


applicationName

public java.lang.String applicationName()
Returns the application name as specified in the request URI. Note that wotonomy web applications do not typically have a .woa extension, but the extension will be included for those that do.


applicationNumber

public int applicationNumber()
Returns the id of the application instance that is needed to service this request. -1 indicates that the request is not specific to a particular instance of the application. This implementation currently returns -1.


requestHandlerKey

public java.lang.String requestHandlerKey()
Returns the portion of the URI that specifies which request handler should handle the request.


requestHandlerPath

public java.lang.String requestHandlerPath()
Returns the portion of the URI that specifies path information for the request, not including the query string.


sessionID

public java.lang.String sessionID()
Returns the unique identifier for the sessions associated with this request, or null if no session is found.


formValueKeys

public net.wotonomy.foundation.NSArray formValueKeys()
Returns an array containing all the form keys in the request.


formValuesForKey

public net.wotonomy.foundation.NSArray formValuesForKey(java.lang.String aKey)
Returns an array of the values for the specified key in no particular order.


formValueForKey

public java.lang.Object formValueForKey(java.lang.String aKey)
Returns one value for the specified key. Provided as a convenience since most keys have only one value. Returns null if not found.


stringFormValueForKey

public java.lang.String stringFormValueForKey(java.lang.String key)
Returns the value for the specified key, as a String.


formValues

public net.wotonomy.foundation.NSDictionary formValues()
Returns a dictionary containing all the key-value mappings in the request.


isFromClientComponent

public boolean isFromClientComponent()
Returns whether the request is from a java-based client component. This implementation returns false.


cookieValuesForKey

public net.wotonomy.foundation.NSArray cookieValuesForKey(java.lang.String aKey)
Returns an array of cookie values for the specified key in no particular order.


cookieValueForKey

public java.lang.String cookieValueForKey(java.lang.String aKey)
Returns one value for the specified cookie key. Provided as a convenience since most cookies have only one value. Returns null if not found.


cookieValues

public net.wotonomy.foundation.NSDictionary cookieValues()
Returns a dictionary of cookie key-value mappings.


setDefaultFormValueEncoding

public void setDefaultFormValueEncoding(java.lang.String encoding)
Sets the default character encoding.


defaultFormValueEncoding

public java.lang.String defaultFormValueEncoding()
Returns the default form value encoding ("ISO8859_1").


setFormValueEncodingDetectionEnabled

public void setFormValueEncodingDetectionEnabled(boolean enabled)
Sets whether the appropriate encoding scheme for decoding the form values will be automatically determined.


isFormValueEncodingDetectionEnabled

public boolean isFormValueEncodingDetectionEnabled()
Gets whether the appropriate encoding scheme for decoding the form values is currently automatically determined.


formValueEncoding

public int formValueEncoding()
Gets the current method used for decoding form values.



Copyright © 2006 null. All Rights Reserved.