org.apache.struts2.rest
Class DefaultHttpHeaders

java.lang.Object
  extended by org.apache.struts2.rest.DefaultHttpHeaders
All Implemented Interfaces:
HttpHeaders

public class DefaultHttpHeaders
extends java.lang.Object
implements HttpHeaders

Default implementation of rest info that uses fluent-style construction


Constructor Summary
DefaultHttpHeaders()
           
DefaultHttpHeaders(java.lang.String result)
           
 
Method Summary
 java.lang.String apply(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object target)
          Applies the configured information to the response
 DefaultHttpHeaders disableCaching()
           
 java.lang.String getResultCode()
          The result code to process
 int getStatus()
          The HTTP status code
 DefaultHttpHeaders lastModified(java.util.Date date)
           
 DefaultHttpHeaders renderResult(java.lang.String code)
           
 DefaultHttpHeaders setLocation(java.lang.String loc)
           
 DefaultHttpHeaders setLocationId(java.lang.Object id)
           
 void setStatus(int s)
          The HTTP status code
 DefaultHttpHeaders withETag(java.lang.Object etag)
           
 DefaultHttpHeaders withNoETag()
           
 DefaultHttpHeaders withStatus(int code)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHttpHeaders

public DefaultHttpHeaders()

DefaultHttpHeaders

public DefaultHttpHeaders(java.lang.String result)
Method Detail

renderResult

public DefaultHttpHeaders renderResult(java.lang.String code)

withStatus

public DefaultHttpHeaders withStatus(int code)

withETag

public DefaultHttpHeaders withETag(java.lang.Object etag)

withNoETag

public DefaultHttpHeaders withNoETag()

setLocationId

public DefaultHttpHeaders setLocationId(java.lang.Object id)

setLocation

public DefaultHttpHeaders setLocation(java.lang.String loc)

lastModified

public DefaultHttpHeaders lastModified(java.util.Date date)

disableCaching

public DefaultHttpHeaders disableCaching()

apply

public java.lang.String apply(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response,
                              java.lang.Object target)
Description copied from interface: HttpHeaders
Applies the configured information to the response

Specified by:
apply in interface HttpHeaders
Parameters:
request - The request
response - The response
target - The target object, usually the action
Returns:
The result code to process

getStatus

public int getStatus()
Description copied from interface: HttpHeaders
The HTTP status code

Specified by:
getStatus in interface HttpHeaders

setStatus

public void setStatus(int s)
Description copied from interface: HttpHeaders
The HTTP status code

Specified by:
setStatus in interface HttpHeaders

getResultCode

public java.lang.String getResultCode()
Description copied from interface: HttpHeaders
The result code to process

Specified by:
getResultCode in interface HttpHeaders


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.