Methods Summary |
---|
public void | addHeader(java.lang.String name, java.lang.String value)Adds an HTTP header to the response
headers.put(name, value);
|
public void | execute(com.opensymphony.xwork2.ActionInvocation invocation)Sets the optional HTTP response status code and also re-sets HTTP headers after they've
been optionally evaluated against the ValueStack.
HttpServletResponse response = ServletActionContext.getResponse();
if (status != -1) {
response.setStatus(status);
}
if (headers != null) {
ValueStack stack = ActionContext.getContext().getValueStack();
for (Iterator iterator = headers.entrySet().iterator();
iterator.hasNext();) {
Map.Entry entry = (Map.Entry) iterator.next();
String value = (String) entry.getValue();
String finalValue = parse ? TextParseUtil.translateVariables(value, stack) : value;
response.addHeader((String) entry.getKey(), finalValue);
}
}
|
public java.util.Map | getHeaders()Returns a Map of all HTTP headers.
return headers;
|
public void | setParse(boolean parse)Sets whether or not the HTTP header values should be evaluated against the ValueStack (by default they are).
this.parse = parse;
|
public void | setStatus(int status)Sets the http servlet response status code that should be set on a response.
this.status = status;
|