org.apache.beehive.netui.pageflow.scoping
Interface ScopedResponse

All Superinterfaces
javax.servlet.http.HttpServletResponse, javax.servlet.ServletResponse
All Known Implementing Classes:
ScopedResponseImpl

public interface ScopedResponse
extends javax.servlet.http.HttpServletResponse

A wrapper around HttpServletResponse, associated with a given scope-key. Delegates to the wrapped response object for some functionality, but prevents output or error codes or forwards from actually happening.


Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletResponse
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY
 
Method Summary
 void applyRedirect()
          Actually send the redirect that was suggested by HttpServletResponse.sendRedirect(java.lang.String).
 boolean didRedirect()
          Tell whether a browser redirect was sent.
 javax.servlet.http.Cookie getCookie(String cookieName)
          Get a cookie that was added to the response.
 javax.servlet.http.Cookie[] getCookies()
          Get all Cookies that were added to the response.
 Object getFirstHeader(String name)
          Get the first header with the given name.
 Map getHeaders()
          Get all headers.
 List getHeaders(String name)
          Get all headers with the given name.
 javax.servlet.http.HttpServletResponse getOuterResponse()
           
 String getRedirectURI()
          Get the redirect URI.
 int getStatusCode()
          Get the status code on the response.
 String getStatusMessage()
          Get the status message on the response.
 boolean isError()
          Tell whether the response is in error.
 
Methods inherited from interface javax.servlet.http.HttpServletResponse
addCookie, addDateHeader, addHeader, addIntHeader, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, sendError, sendError, sendRedirect, setDateHeader, setHeader, setIntHeader, setStatus, setStatus
 
Methods inherited from interface javax.servlet.ServletResponse
flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setContentType, setLocale
 

Method Detail

getCookie

javax.servlet.http.Cookie getCookie(String cookieName)
Get a cookie that was added to the response.


getCookies

javax.servlet.http.Cookie[] getCookies()
Get all Cookies that were added to the response.


getHeaders

Map getHeaders()
Get all headers.

Returns
a Map of header-name (String) -> headers (List).

getHeaders

List getHeaders(String name)
Get all headers with the given name.

Returns
a List of headers (String, Integer, Date), or null if none are found.

getFirstHeader

Object getFirstHeader(String name)
Get the first header with the given name.

Returns
an Object (String, Integer, Date) that is the first header with the given name, or null if none is found.

getOuterResponse

javax.servlet.http.HttpServletResponse getOuterResponse()

isError

boolean isError()
Tell whether the response is in error.

Returns
true if HttpServletResponse.sendError(int,String) or HttpServletResponse.sendError(int) was called.

getStatusCode

int getStatusCode()
Get the status code on the response.

Returns
the status code, set by HttpServletResponse.setStatus(int), HttpServletResponse.sendError(int,String), or HttpServletResponse.sendError(int); -1 if no status was set explicitly.

getStatusMessage

String getStatusMessage()
Get the status message on the response.

Returns
the status code, set by HttpServletResponse.sendError(int,String), or null if none was set.

didRedirect

boolean didRedirect()
Tell whether a browser redirect was sent.

Returns
true if HttpServletResponse.sendRedirect(java.lang.String) was called.

getRedirectURI

String getRedirectURI()
Get the redirect URI.

Returns
the URI passed to HttpServletResponse.sendRedirect(java.lang.String), or null if there was no redirect.

applyRedirect

void applyRedirect()
                   throws IOException
Actually send the redirect that was suggested by HttpServletResponse.sendRedirect(java.lang.String).

Throws
IllegalStateException - if HttpServletResponse.sendRedirect(java.lang.String) was not called.
IOException - if HttpServletResponse.sendRedirect(java.lang.String) causes an IOException.


Copyright © 2011, Oracle. All rights reserved.