ERXResponse Class Reference

Inherits com::webobjects::appserver::WOResponse.

Inherited by AjaxResponse, and ERXKeepAliveResponse.

Collaboration diagram for ERXResponse:

Collaboration graph
[legend]

List of all members.

Classes

class  Context

Public Member Functions

void _appendTagAttributeAndValue (String name, String value, boolean escape)
void _finalizeInContext (WOContext originalContext)
String contentDisposition ()
String contentType ()
void disableClientCaching ()
 ERXResponse (WOContext context)
 ERXResponse (String content)
 ERXResponse (String content, int status)
 ERXResponse ()
boolean isAttachment ()
boolean isHTML ()
boolean isIE ()
boolean isPageCachingDisabled ()
void mark (String key)
void popContent (boolean append)
void pushContent ()
void setUserInfoForKey (Object value, String key)
Object userInfoForKey (String key)

Static Public Member Functions

static boolean isXHTML (WOResponse response)
static ERXResponse popPartial ()
static ERXResponse pushPartial (String key)
static void setXHTML (WOResponse response, boolean xhtml)

Static Public Attributes

static final String ContentDispositionHeaderKey = "content-disposition"
static final String ContentTypeHeaderKey = "content-type"
static final String DisablePageCachingKey = "com.webobjects.appserver.Response.DisablePageCaching"

Protected Member Functions

void __setContent (Object appendable)

Static Private Member Functions

static Context currentContext ()

Private Attributes

Stack< Object > _contentStack
WOContext _context
LinkedHashMap< String, Integer > marks


Detailed Description

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


Constructor & Destructor Documentation

ERXResponse (  ) 

ERXResponse ( String  content,
int  status 
)

Convenience constructor for direct actions.

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

ERXResponse ( String  content  ) 

Convenience constructor for direct actions.

Parameters:
content text content of the response

ERXResponse ( WOContext  context  ) 


Member Function Documentation

void __setContent ( Object  appendable  )  [protected]

void _appendTagAttributeAndValue ( String  name,
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.

void _finalizeInContext ( WOContext  originalContext  ) 

Overridden to insert the partials in the respective area.

String contentDisposition (  ) 

Returns:
header value for ContentDispositionHeaderKey

String contentType (  ) 

Returns:
header value for ContentTypeHeaderKey

static Context currentContext (  )  [static, private]

void disableClientCaching (  ) 

Overridden to not call super if trying to download an attachment to IE.

See also:
com.webobjects.appserver.WOResponse.disableClientCaching()

boolean isAttachment (  ) 

boolean isHTML (  ) 

Returns:
true if the content type of this response indicates HTML

boolean isIE (  ) 

Returns:
true if the Request this Response is for has a user agent that indicates and IE browser

boolean isPageCachingDisabled (  ) 

See also:
disablePageCaching()
Returns:
true if disablePageCaching() has been called for this response

static boolean isXHTML ( WOResponse  response  )  [static]

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

void mark ( String  key  ) 

Call this to mark the place where a partial should get rendered.

Parameters:
key 

void popContent ( boolean  append  ) 

Pops the last _content off the stack, optionally appending the current content to it.

Parameters:
append 

static ERXResponse popPartial (  )  [static]

Returns the top-most response after this one has been pulled from the stack.

Returns:
the previous partial

void pushContent (  ) 

Pushes a new _content onto the stack, so you can write to this response and capture the output.

static ERXResponse pushPartial ( String  key  )  [static]

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

void setUserInfoForKey ( Object  value,
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

require [valid_value] value != null; [valid_key] key != null;

ensure [value_set] userInfoForKey(key).equals(value);

static void setXHTML ( WOResponse  response,
boolean  xhtml 
) [static]

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

Object userInfoForKey ( 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

require [valid_key] key != null;


Member Data Documentation

Stack<Object> _contentStack [private]

WOContext _context [private]

Reimplemented in AjaxResponse.

final String ContentDispositionHeaderKey = "content-disposition" [static]

final String ContentTypeHeaderKey = "content-type" [static]

final String DisablePageCachingKey = "com.webobjects.appserver.Response.DisablePageCaching" [static]

LinkedHashMap<String, Integer> marks [private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:02 2012 for Project Wonder by  doxygen 1.5.8