org.springframework.extensions.webscripts.jsf
Class WebScriptJSFResponse

java.lang.Object
  extended by org.springframework.extensions.webscripts.WebScriptResponseImpl
      extended by org.springframework.extensions.webscripts.jsf.WebScriptJSFResponse
All Implemented Interfaces:
WebScriptResponse

public class WebScriptJSFResponse
extends WebScriptResponseImpl
implements WebScriptResponse

Implementation of a WebScript Response for the JSF environment.

Author:
Kevin Roast

Field Summary
 
Fields inherited from interface org.springframework.extensions.webscripts.WebScriptResponse
ATOM_FORMAT, HEADER_LOCATION, HTML_FORMAT, JSON_FORMAT, OPENSEARCH_DESCRIPTION_FORMAT, RSS_FORMAT, 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
 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
 
Methods inherited from class org.springframework.extensions.webscripts.WebScriptResponseImpl
getRuntime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.extensions.webscripts.WebScriptResponse
getRuntime
 

Method Detail

encodeScriptUrl

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

Specified by:
encodeScriptUrl in interface WebScriptResponse
Parameters:
url - to encode
Returns:
encoded url
See Also:
WebScriptResponse.encodeScriptUrl(java.lang.String)

reset

public void reset()
Description copied from interface: WebScriptResponse
Clears response buffer

Specified by:
reset in interface WebScriptResponse
See Also:
WebScriptResponse.reset()

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Description copied from interface: WebScriptResponse
Gets the Output Stream

Specified by:
getOutputStream in interface WebScriptResponse
Returns:
output stream
Throws:
IOException
See Also:
WebScriptResponse.getOutputStream()

getWriter

public Writer getWriter()
                 throws IOException
Description copied from interface: WebScriptResponse
Gets the Writer

Specified by:
getWriter in interface WebScriptResponse
Returns:
writer
Throws:
IOException
See Also:
WebScriptResponse.getWriter()

setStatus

public void setStatus(int status)
Description copied from interface: WebScriptResponse
Sets the Response Status

Specified by:
setStatus in interface WebScriptResponse
See Also:
WebScriptResponse.setStatus(int)

setHeader

public void setHeader(String name,
                      String value)
Description copied from interface: WebScriptResponse
Set a response header with the given name and value. If the header has already been set, the new value overwrites the previous one.

Specified by:
setHeader in interface WebScriptResponse
Parameters:
name - header name
value - header value
See Also:
WebScriptResponse.setHeader(java.lang.String, java.lang.String)

addHeader

public void addHeader(String name,
                      String value)
Description copied from interface: WebScriptResponse
Adds a response header with the given name and value. This method allows a response header to have multiple values.

Specified by:
addHeader in interface WebScriptResponse
Parameters:
name - header name
value - header value
See Also:
WebScriptResponse.addHeader(java.lang.String, java.lang.String)

setCache

public void setCache(Cache cache)
Description copied from interface: WebScriptResponse
Sets the Cache control

Specified by:
setCache in interface WebScriptResponse
Parameters:
cache - cache control
See Also:
org.springframework.extensions.webscripts.WebScriptResponse#setCache()

setContentType

public void setContentType(String contentType)
Description copied from interface: WebScriptResponse
Sets the Content Type

Specified by:
setContentType in interface WebScriptResponse
See Also:
WebScriptResponse.setContentType(java.lang.String)

setContentEncoding

public void setContentEncoding(String contentEncoding)
Description copied from interface: WebScriptResponse
Sets the Content Encoding

Specified by:
setContentEncoding in interface WebScriptResponse

getEncodeScriptUrlFunction

public String getEncodeScriptUrlFunction(String name)
Description copied from interface: WebScriptResponse
Return a client side javascript function to build urls to this service

Specified by:
getEncodeScriptUrlFunction in interface WebScriptResponse
Parameters:
name - Generated function name
Returns:
javascript function definition


Copyright © 2009 SpringSource, Inc. All Rights Reserved.