Added "body", "title" and "message" fields

This commit is contained in:
hns 2001-01-08 18:29:33 +00:00
parent 947fd19024
commit ea128e6cc3

View file

@ -16,8 +16,8 @@ import helma.util.*;
public class ResponseTrans implements Serializable { public class ResponseTrans implements Serializable {
public String contentType = "text/html"; public String contentType = "text/html";
// the page body // the actual response
private char[] body = null; private char[] response = null;
// contains the redirect URL // contains the redirect URL
public String redirect = null; public String redirect = null;
@ -30,14 +30,21 @@ public class ResponseTrans implements Serializable {
// used to allow or disable client side caching // used to allow or disable client side caching
public boolean cache = true; public boolean cache = true;
// the buffer used to build the body // the buffer used to build the response
private transient StringBuffer buffer = null; private transient StringBuffer buffer = null;
// these are used to implement the _as_string variants for Hop templates. // these are used to implement the _as_string variants for Hop templates.
private transient Stack buffers; private transient Stack buffers;
// the buffers used to build the single body parts -
// transient, response must be constructed before this is serialized
public transient String title;
public transient String body;
public transient String message;
public ResponseTrans () { public ResponseTrans () {
super (); super ();
title = body = message = "";
} }
public void reset () { public void reset () {
@ -137,16 +144,16 @@ public class ResponseTrans implements Serializable {
*/ */
public void close () { public void close () {
if (buffer != null) if (buffer != null)
body = new String (buffer).toCharArray(); response = new String (buffer).toCharArray();
} }
public String getContentString () { public String getContentString () {
return body == null ? "" : new String (body); return response == null ? "" : new String (response);
} }
public int getContentLength () { public int getContentLength () {
if (body != null) if (response != null)
return body.length; return response.length;
return 0; return 0;
} }