org.apache.tapestry.portlet
Class PortletWebResponse

java.lang.Object
  extended by org.apache.tapestry.portlet.PortletWebResponse
All Implemented Interfaces:
WebResponse
Direct Known Subclasses:
RenderWebResponse

public class PortletWebResponse
extends Object
implements WebResponse

Adapts PortletResponse as WebResponse.

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
PortletWebResponse(javax.portlet.PortletResponse portletResponse)
           
 
Method Summary
 String encodeURL(String url)
          Encodes a URL, which adds information to the URL needed to ensure that the request triggered by the URL will be associated with the current session (if any).
 String getNamespace()
          Returns the empty string.
 OutputStream getOutputStream(ContentType contentType)
          Returns a output stream to which output should be sent.
 PrintWriter getPrintWriter(ContentType contentType)
          Returns a PrintWriter to which output should be sent.
 void reset()
          Unsupported.
 void sendError(int statusCode, String message)
          Unsupported.
 void setContentLength(int contentLength)
          Unsupported.
 void setDateHeader(String string, long date)
          Unsupported.
 void setHeader(String name, String value)
          Unsupported.
 void setIntHeader(String name, int value)
          Unsupported.
 void setStatus(int status)
          Unsupported.
protected  void unsupported(String methodName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortletWebResponse

public PortletWebResponse(javax.portlet.PortletResponse portletResponse)
Method Detail

getOutputStream

public OutputStream getOutputStream(ContentType contentType)
                             throws IOException
Description copied from interface: WebResponse
Returns a output stream to which output should be sent. This method should only be invoked once on a response.

Specified by:
getOutputStream in interface WebResponse
Parameters:
contentType - The encoding type that this outputstream will write content as.
Returns:
the output stream, configured for the given type.
Throws:
IOException - On io error.

getPrintWriter

public PrintWriter getPrintWriter(ContentType contentType)
                           throws IOException
Description copied from interface: WebResponse
Returns a PrintWriter to which output should be sent. This method should be invoked once on a response. A second call is expected to be so that an exception page can be rendered, and the underlying request data is reset.

Specified by:
getPrintWriter in interface WebResponse
Parameters:
contentType - The type of content encoding the writer is for.
Returns:
A new PrintWriter instance.
Throws:
IOException - On io error.

encodeURL

public String encodeURL(String url)
Description copied from interface: WebResponse
Encodes a URL, which adds information to the URL needed to ensure that the request triggered by the URL will be associated with the current session (if any). In most cases, the string is returned unchanged.

Specified by:
encodeURL in interface WebResponse
Parameters:
url - The URL to encode.
Returns:
The url encoded.

reset

public void reset()
Unsupported.

Specified by:
reset in interface WebResponse

setContentLength

public void setContentLength(int contentLength)
Unsupported.

Specified by:
setContentLength in interface WebResponse
Parameters:
contentLength - The total content length this response will write.

getNamespace

public String getNamespace()
Returns the empty string. The RenderWebResponse subclass actually provides a real value here.

Specified by:
getNamespace in interface WebResponse
Returns:
The namespace that this requests resources should be pre-pended with.

unsupported

protected final void unsupported(String methodName)

setDateHeader

public void setDateHeader(String string,
                          long date)
Unsupported.

Specified by:
setDateHeader in interface WebResponse
Parameters:
string - the name of the header to set
date - the date value to set, in milliseconds since the epoch

setStatus

public void setStatus(int status)
Unsupported.

Specified by:
setStatus in interface WebResponse
Parameters:
status - The HTTP status code to set on the return header.

setHeader

public void setHeader(String name,
                      String value)
Unsupported.

Specified by:
setHeader in interface WebResponse
Parameters:
name - the name of the header to set
value - the value for the named header

setIntHeader

public void setIntHeader(String name,
                         int value)
Unsupported.

Specified by:
setIntHeader in interface WebResponse
Parameters:
name - the name of the header to set
value - the value for the named header

sendError

public void sendError(int statusCode,
                      String message)
               throws IOException
Unsupported.

Specified by:
sendError in interface WebResponse
Parameters:
statusCode - The error status code to set on the header.
message - The message to give as the reason for error.
Throws:
IOException - on io error.


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.