Project Wonder 5.0

er.extensions.appserver
Class ERXResponse

java.lang.Object
  extended by com.webobjects.appserver.WOMessage
      extended by com.webobjects.appserver.WOResponse
          extended by er.extensions.appserver.ERXResponse
All Implemented Interfaces:
com.webobjects.appserver.WOActionResults, com.webobjects.foundation.NSKeyValueCoding, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCodingAdditions, java.lang.Cloneable
Direct Known Subclasses:
AjaxResponse, ERXKeepAliveResponse

public class ERXResponse
extends com.webobjects.appserver.WOResponse

ERXResponse provides a place to override methods of WOResponse. This is returned by default from ERXApplication. Also has support for "partials", i.e. in your render tree, you can define a new "partial", where the content will actually get rendered.

Author:
mschrag, ak

Nested Class Summary
static class ERXResponse.Context
           
 
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
static java.lang.String ContentDispositionHeaderKey
           
static java.lang.String ContentTypeHeaderKey
           
static java.lang.String DisablePageCachingKey
           
 
Fields inherited from class com.webobjects.appserver.WOResponse
_contentInputStream, _contentInputStreamBufferSize, _contentInputStreamLength
 
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
ERXResponse()
           
ERXResponse(java.lang.String content)
          Convenience constructor for direct actions.
ERXResponse(java.lang.String content, int status)
          Convenience constructor for direct actions.
ERXResponse(com.webobjects.appserver.WOContext context)
           
 
Method Summary
protected  void __setContent(java.lang.Object appendable)
           
 void _appendTagAttributeAndValue(java.lang.String name, java.lang.String value, boolean escape)
          The original _appendTagAttributeAndValue would skip null values, but not blank values, which would produce html like <div style = "">.
 void _finalizeInContext(com.webobjects.appserver.WOContext originalContext)
          Overridden to insert the partials in the respective area.
 java.lang.String contentDisposition()
           
 java.lang.String contentType()
           
 void disableClientCaching()
          Overridden to not call super if trying to download an attachment to IE.
 boolean isAttachment()
           
 boolean isHTML()
           
 boolean isIE()
           
 boolean isPageCachingDisabled()
           
static boolean isXHTML(com.webobjects.appserver.WOResponse response)
          Returns whether or not XHTML is turned on for the given response.
 void mark(java.lang.String key)
          Call this to mark the place where a partial should get rendered.
 void popContent(boolean append)
          Pops the last _content off the stack, optionally appending the current content to it.
static ERXResponse popPartial()
          Returns the top-most response after this one has been pulled from the stack.
 void pushContent()
          Pushes a new _content onto the stack, so you can write to this response and capture the output.
static ERXResponse pushPartial(java.lang.String key)
          Returns the associated response for the supplied key.
 void setUserInfoForKey(java.lang.Object value, java.lang.String key)
          WO 5.4 API Sets the value for key in the user info dictionary.
static void setXHTML(com.webobjects.appserver.WOResponse response, boolean xhtml)
          Sets whether the given response should turn on XHTML tag rendering.
 java.lang.Object userInfoForKey(java.lang.String key)
          WO 5.4 API
 
Methods inherited from class com.webobjects.appserver.WOResponse
_isClientCachingDisabled, _redirectionResponseForAbsoluteURL, _redirectResponse, clone, contentInputStream, contentInputStreamBufferSize, contentInputStreamLength, generateResponse, setContentStream, setStatus, status, toString
 
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, cookies, 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
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ContentDispositionHeaderKey

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

ContentTypeHeaderKey

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

DisablePageCachingKey

public static final java.lang.String DisablePageCachingKey
See Also:
Constant Field Values
Constructor Detail

ERXResponse

public ERXResponse()

ERXResponse

public ERXResponse(java.lang.String content,
                   int status)
Convenience constructor for direct actions.

Parameters:
content - text content of the response
status - HTTP status code of the response

ERXResponse

public ERXResponse(java.lang.String content)
Convenience constructor for direct actions.

Parameters:
content - text content of the response

ERXResponse

public ERXResponse(com.webobjects.appserver.WOContext context)
Method Detail

__setContent

protected void __setContent(java.lang.Object appendable)

pushContent

public void pushContent()
Pushes a new _content onto the stack, so you can write to this response and capture the output.


popContent

public void popContent(boolean append)
Pops the last _content off the stack, optionally appending the current content to it.

Parameters:
append -

mark

public void mark(java.lang.String key)
Call this to mark the place where a partial should get rendered.

Parameters:
key -

_finalizeInContext

public void _finalizeInContext(com.webobjects.appserver.WOContext originalContext)
Overridden to insert the partials in the respective area.

Overrides:
_finalizeInContext in class com.webobjects.appserver.WOResponse

pushPartial

public static ERXResponse pushPartial(java.lang.String key)
Returns the associated response for the supplied key. Creates it if needed.

Parameters:
key - the key to push the partial as
Returns:
the new ERXResponse to write to

popPartial

public static ERXResponse popPartial()
Returns the top-most response after this one has been pulled from the stack.

Returns:
the previous partial

_appendTagAttributeAndValue

public void _appendTagAttributeAndValue(java.lang.String name,
                                        java.lang.String value,
                                        boolean escape)
The original _appendTagAttributeAndValue would skip null values, but not blank values, which would produce html like <div style = "">. This implementation also skips blank values.

Overrides:
_appendTagAttributeAndValue in class com.webobjects.appserver.WOResponse

disableClientCaching

public void disableClientCaching()
Overridden to not call super if trying to download an attachment to IE.

Overrides:
disableClientCaching in class com.webobjects.appserver.WOResponse
See Also:
WOResponse.disableClientCaching()

isPageCachingDisabled

public boolean isPageCachingDisabled()
Returns:
true if disablePageCaching() has been called for this response
See Also:
#disablePageCaching()

setUserInfoForKey

public void setUserInfoForKey(java.lang.Object value,
                              java.lang.String key)
WO 5.4 API Sets the value for key in the user info dictionary.

Parameters:
value - value to add to userInfo()
key - key to add value under

userInfoForKey

public java.lang.Object userInfoForKey(java.lang.String key)
WO 5.4 API

Parameters:
key - key to return value from userInfo() for
Returns:
value from userInfo() for key, or null if not available

isAttachment

public boolean isAttachment()

isHTML

public boolean isHTML()
Returns:
true if the content type of this response indicates HTML

contentDisposition

public java.lang.String contentDisposition()
Returns:
header value for ContentDispositionHeaderKey

contentType

public java.lang.String contentType()
Returns:
header value for ContentTypeHeaderKey

isIE

public boolean isIE()
Returns:
true if the Request this Response is for has a user agent that indicates and IE browser

setXHTML

public static void setXHTML(com.webobjects.appserver.WOResponse response,
                            boolean xhtml)
Sets whether the given response should turn on XHTML tag rendering.

Parameters:
response - the response to turn XHTML on for
xhtml - whether or not XHTML should be turned on

isXHTML

public static boolean isXHTML(com.webobjects.appserver.WOResponse response)
Returns whether or not XHTML is turned on for the given response.

Parameters:
response - the response to check XHTML for
Returns:
whether or not XHTML was turned on

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

Copyright © 2002 – 2007 Project Wonder.