org.springframework.extensions.webscripts
Interface WebScriptResponse

All Known Subinterfaces:
WrappingWebScriptResponse
All Known Implementing Classes:
LocalWebScriptResponse, WebScriptJSFResponse, WebScriptPortletResponse, WebScriptResponseImpl, WebScriptServletResponse, WebScriptServletResponse

public interface WebScriptResponse

Web Script Response

Author:
davidc

Field Summary
static String ATOM_FORMAT
           
static String HEADER_LOCATION
           
static String HTML_FORMAT
           
static String JSON_FORMAT
           
static String OPENSEARCH_DESCRIPTION_FORMAT
           
static String RSS_FORMAT
           
static String XML_FORMAT
           
 
Method Summary
 void addHeader(String name, String value)
          Adds a response header with the given name and value.
 String encodeScriptUrl(String url)
          Encode a script URL Note: Some Web Script Runtime environments (e.g.
 String getEncodeScriptUrlFunction(String name)
          Return a client side javascript function to build urls to this service
 OutputStream getOutputStream()
          Gets the Output Stream
 Runtime getRuntime()
          Gets the initiating runtime
 Writer getWriter()
          Gets the Writer
 void reset()
          Clears response buffer
 void setCache(Cache cache)
          Sets the Cache control
 void setContentEncoding(String contentEncoding)
          Sets the Content Encoding
 void setContentType(String contentType)
          Sets the Content Type
 void setHeader(String name, String value)
          Set a response header with the given name and value.
 void setStatus(int status)
          Sets the Response Status
 

Field Detail

HTML_FORMAT

static final String HTML_FORMAT
See Also:
Constant Field Values

ATOM_FORMAT

static final String ATOM_FORMAT
See Also:
Constant Field Values

RSS_FORMAT

static final String RSS_FORMAT
See Also:
Constant Field Values

XML_FORMAT

static final String XML_FORMAT
See Also:
Constant Field Values

JSON_FORMAT

static final String JSON_FORMAT
See Also:
Constant Field Values

OPENSEARCH_DESCRIPTION_FORMAT

static final String OPENSEARCH_DESCRIPTION_FORMAT
See Also:
Constant Field Values

HEADER_LOCATION

static final String HEADER_LOCATION
See Also:
Constant Field Values
Method Detail

setStatus

void setStatus(int status)
Sets the Response Status

Parameters:
status -

setHeader

void setHeader(String name,
               String value)
Set a response header with the given name and value. If the header has already been set, the new value overwrites the previous one.

Parameters:
name - header name
value - header value

addHeader

void addHeader(String name,
               String value)
Adds a response header with the given name and value. This method allows a response header to have multiple values.

Parameters:
name - header name
value - header value

setContentType

void setContentType(String contentType)
Sets the Content Type

Parameters:
contentType -

setContentEncoding

void setContentEncoding(String contentEncoding)
Sets the Content Encoding

Parameters:
contentEncoding -

setCache

void setCache(Cache cache)
Sets the Cache control

Parameters:
cache - cache control

getWriter

Writer getWriter()
                 throws IOException
Gets the Writer

Returns:
writer
Throws:
IOException

getOutputStream

OutputStream getOutputStream()
                             throws IOException
Gets the Output Stream

Returns:
output stream
Throws:
IOException

reset

void reset()
Clears response buffer


encodeScriptUrl

String encodeScriptUrl(String url)
Encode a script URL Note: Some Web Script Runtime environments (e.g. JSR-168, JSF) require urls to be re-written.

Parameters:
url - to encode
Returns:
encoded url

getEncodeScriptUrlFunction

String getEncodeScriptUrlFunction(String name)
Return a client side javascript function to build urls to this service

Parameters:
name - Generated function name
Returns:
javascript function definition

getRuntime

Runtime getRuntime()
Gets the initiating runtime

Returns:
runtime that constructed this response


Copyright © 2009 SpringSource, Inc. All Rights Reserved.