com.opensymphony.webwork.dispatcher
Class HttpHeaderResult

java.lang.Object
  extended by com.opensymphony.webwork.dispatcher.WebWorkResultSupport
      extended by com.opensymphony.webwork.views.AbstractHttpHeaderPopulatingResult
          extended by com.opensymphony.webwork.dispatcher.HttpHeaderResult
All Implemented Interfaces:
WebWorkStatics, Result, Serializable

public class HttpHeaderResult
extends AbstractHttpHeaderPopulatingResult

A custom Result type for evaluating HTTP headers against the ValueStack.

This result type takes the following parameters:

Example:

 <result name="success" type="httpheader">
   <param name="status">204</param>
   <param name="headers.a">a custom header value</param>
   <param name="headers.b">another custom header value</param>
 </result>
 

Version:
$Date: 2007-11-30 18:45:26 +0800 (Fri, 30 Nov 2007) $ $Id: HttpHeaderResult.java 2977 2007-11-30 10:45:26Z tm_jee $
Author:
Jason Carreira, tmjee
See Also:
Serialized Form

Field Summary
static String DEFAULT_PARAM
           
 
Fields inherited from class com.opensymphony.webwork.dispatcher.WebWorkResultSupport
encode, location, parse
 
Fields inherited from interface com.opensymphony.webwork.WebWorkStatics
HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER
 
Constructor Summary
HttpHeaderResult()
           
 
Method Summary
protected  void afterHttpHeadersPopulatedExecute(String finalLocation, ActionInvocation invocation)
          Sets the optional HTTP response status code and also re-sets HTTP headers after they've been optionally evaluated against the ValueStack.
 void setParse(boolean parse)
          Sets whether or not the HTTP header values should be evaluated against the ValueStack (by default they are).
 void setStatus(int status)
          Sets the http servlet response status code that should be set on a response.
 
Methods inherited from class com.opensymphony.webwork.views.AbstractHttpHeaderPopulatingResult
doExecute, getHeaders
 
Methods inherited from class com.opensymphony.webwork.dispatcher.WebWorkResultSupport
conditionalParse, execute, setEncode, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PARAM

public static final String DEFAULT_PARAM
See Also:
Constant Field Values
Constructor Detail

HttpHeaderResult

public HttpHeaderResult()
Method Detail

setParse

public void setParse(boolean parse)
Sets whether or not the HTTP header values should be evaluated against the ValueStack (by default they are).

Overrides:
setParse in class WebWorkResultSupport
Parameters:
parse - true if HTTP header values should be evaluated agains the ValueStack, false otherwise.

setStatus

public void setStatus(int status)
Sets the http servlet response status code that should be set on a response.

Parameters:
status - the Http status code
See Also:
HttpServletResponse.setStatus(int)

afterHttpHeadersPopulatedExecute

protected void afterHttpHeadersPopulatedExecute(String finalLocation,
                                                ActionInvocation invocation)
                                         throws Exception
Sets the optional HTTP response status code and also re-sets HTTP headers after they've been optionally evaluated against the ValueStack.

Specified by:
afterHttpHeadersPopulatedExecute in class AbstractHttpHeaderPopulatingResult
Parameters:
finalLocation -
invocation - an encapsulation of the action execution state.
Throws:
Exception - if an error occurs when re-setting the headers.

WebWork Project Page