Skip to content

Commit

Permalink
add ERXResponse(int) constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
darkv committed May 30, 2012
1 parent 4bbf30c commit 8038c22
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ public ERXResponse(String content, int status) {
public ERXResponse(String content) {
setContent(content);
}

/**
* Convenience constructor for direct actions.
* @param status HTTP status code of the response
*/
public ERXResponse(int status) {
setStatus(status);
}

public ERXResponse(WOContext context) {
_context = context;
Expand Down Expand Up @@ -124,6 +132,7 @@ public void mark(String key) {

/**
* Overridden to insert the partials in the respective area.
* @param originalContext context
*/
@Override
public void _finalizeInContext(WOContext originalContext) {
Expand Down Expand Up @@ -200,7 +209,12 @@ public static ERXResponse popPartial() {
* The original _appendTagAttributeAndValue would skip null values, but not
* blank values, which would produce html like <div style = "">. This
* implementation also skips blank values.
*
* @param name attribute name
* @param value attribute value
* @param escape <code>true</code> if value should be escaped
*/
// REMOVEME as of WO5.4.3 this seems not necessary anymore
@Override
public void _appendTagAttributeAndValue(String name, String value, boolean escape) {
if (value != null) {
Expand Down Expand Up @@ -261,7 +275,7 @@ public void setUserInfoForKey(Object value, String key) {
*
* @param key
* key to return value from userInfo() for
* @return value from userInfo() for key, or null if not available
* @return value from {@link #userInfo()} for key, or <code>null</code> if not available
*/
public Object userInfoForKey(String key) {
/** require [valid_key] key != null; **/
Expand Down

0 comments on commit 8038c22

Please sign in to comment.