com.droplets.apix.servlet
Class DropletsHttpServletResponse

java.lang.Object
  |
  +--com.droplets.apix.servlet.DropletsHttpServletResponse
All Implemented Interfaces:
javax.servlet.http.HttpServletResponse, javax.servlet.ServletResponse

public class DropletsHttpServletResponse
extends java.lang.Object
implements javax.servlet.http.HttpServletResponse

Implements HttpServletResponse for use in a Droplet calling a Servlet. Use it to call your Servlet's doGetService and doPostService. Many of the methods are marked as "Not implemented". This is because there is no Droplets alternative and probably depends on the specifics of the Servlet being used. It is expected that you subclass DropletsHttpServletResponse and provide an implementation that is appropriate for the Servlet you are trying to call. Most of the methods that are marked as "Not implemented" have a default implementation that may be appropriate, but are marked that way nonetheless to alert the developer to check to see if they need something else.

Copyright: Copyright (c) 2003

Company: Droplets


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_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_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY
 
Constructor Summary
DropletsHttpServletResponse()
          Construct objects of DropletsHttpServletResponse to pass to your Servlet's doGetService() and doPostService()
 
Method Summary
 void addCookie(javax.servlet.http.Cookie cookie)
          Not implemented.
 void addDateHeader(java.lang.String name, long date)
          Not implemented.
 void addHeader(java.lang.String name, java.lang.String value)
          Not implemented.
 void addIntHeader(java.lang.String name, int value)
          Not implemented.
 boolean containsHeader(java.lang.String name)
          Not implemented.
 java.lang.String encodeRedirectUrl(java.lang.String url)
          Not implemented.
 java.lang.String encodeRedirectURL(java.lang.String url)
          Not implemented.
 java.lang.String encodeUrl(java.lang.String url)
          Not implemented.
 java.lang.String encodeURL(java.lang.String url)
          Not implemented.
 void flushBuffer()
          Not implemented.
 int getBufferSize()
          Returns the value passed to setBufferSize (default is 0)
 java.lang.String getCharacterEncoding()
          Returns the argument passed to setCharacterEncoding (or "ISO-8859-1" if it was never called)
 java.lang.String getContentType()
          Gets the content type set by setContentType() (default "text/html; charset=ISO-8859-4")
 java.util.Locale getLocale()
          Returns the value passed to setLocale (default is Locale.getDefault())
 javax.servlet.ServletOutputStream getOutputStream()
          Gets the stream for writing the result.
 java.io.PrintWriter getWriter()
          Not Implemented.
 boolean isCommitted()
          Not implemented.
 void reset()
          Clears the output stream
 void resetBuffer()
          Clears the output stream
 void sendError(int sc)
          Not implemented.
 void sendError(int sc, java.lang.String msg)
          Not implemented.
 void sendRedirect(java.lang.String location)
          Not implemented.
 void setBufferSize(int size)
          Used to set the return value of getBufferSize (default is 0)
 void setCharacterEncoding(java.lang.String charset)
          Sets the encoding.
 void setContentLength(int len)
          Not implemented.
 void setContentType(java.lang.String type)
          Sets the content type returned by getContentType() (default "text/html; charset=ISO-8859-4")
 void setDateHeader(java.lang.String name, long date)
          Not implemented.
 void setHeader(java.lang.String name, java.lang.String value)
          Not implemented.
 void setIntHeader(java.lang.String name, int value)
          Not implemented.
 void setLocale(java.util.Locale loc)
          Used to set the return value of getLocale (default is Locale.getDefault())
 void setStatus(int sc)
          Not implemented.
 void setStatus(int sc, java.lang.String sm)
          Not implemented.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DropletsHttpServletResponse

public DropletsHttpServletResponse()
Construct objects of DropletsHttpServletResponse to pass to your Servlet's doGetService() and doPostService()
Method Detail

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Returns the argument passed to setCharacterEncoding (or "ISO-8859-1" if it was never called)
Specified by:
getCharacterEncoding in interface javax.servlet.ServletResponse
Returns:
the argument passed to setCharacterEncoding (or "ISO-8859-1" if it was never called)

setCharacterEncoding

public void setCharacterEncoding(java.lang.String charset)
Sets the encoding. If it is never called, the default encoding is "ISO-8859-1"
Parameters:
the - encoding of the result.

getOutputStream

public javax.servlet.ServletOutputStream getOutputStream()
                                                  throws java.io.IOException
Gets the stream for writing the result. If you call a Servlet that does this, you can cast the return to DropletsServletOutputStream and retrieve the result.
Specified by:
getOutputStream in interface javax.servlet.ServletResponse
Returns:
a DropletsServletOutputStream object to write or retrieve the result

getWriter

public java.io.PrintWriter getWriter()
                              throws java.io.IOException
Not Implemented. This always throws IllegalStateException. does. Use getOutputStream instead (or subclass and implement)
Specified by:
getWriter in interface javax.servlet.ServletResponse
Returns:
Never returns, always throws IllegalStateException

setContentLength

public void setContentLength(int len)
Not implemented. The parameter is ignored
Specified by:
setContentLength in interface javax.servlet.ServletResponse
Parameters:
len - ignored.

setContentType

public void setContentType(java.lang.String type)
Sets the content type returned by getContentType() (default "text/html; charset=ISO-8859-4")
Specified by:
setContentType in interface javax.servlet.ServletResponse
Parameters:
type - used as the result of getContentType()

getContentType

public java.lang.String getContentType()
Gets the content type set by setContentType() (default "text/html; charset=ISO-8859-4")
Returns:
the argument passed to the last call of setContentType()

setBufferSize

public void setBufferSize(int size)
Used to set the return value of getBufferSize (default is 0)
Specified by:
setBufferSize in interface javax.servlet.ServletResponse
Parameters:
size - sets the return value of getBufferSize

getBufferSize

public int getBufferSize()
Returns the value passed to setBufferSize (default is 0)
Specified by:
getBufferSize in interface javax.servlet.ServletResponse
Returns:
the value passed to setBufferSize

flushBuffer

public void flushBuffer()
                 throws java.io.IOException
Not implemented. Does nothing.
Specified by:
flushBuffer in interface javax.servlet.ServletResponse

resetBuffer

public void resetBuffer()
Clears the output stream

isCommitted

public boolean isCommitted()
Not implemented. Always returns true.
Specified by:
isCommitted in interface javax.servlet.ServletResponse

reset

public void reset()
Clears the output stream
Specified by:
reset in interface javax.servlet.ServletResponse

setLocale

public void setLocale(java.util.Locale loc)
Used to set the return value of getLocale (default is Locale.getDefault())
Specified by:
setLocale in interface javax.servlet.ServletResponse
Parameters:
loc - sets the return value of getLocale

getLocale

public java.util.Locale getLocale()
Returns the value passed to setLocale (default is Locale.getDefault())
Specified by:
getLocale in interface javax.servlet.ServletResponse
Returns:
the value passed to setLocale

addCookie

public void addCookie(javax.servlet.http.Cookie cookie)
Not implemented. The call is ignored.
Specified by:
addCookie in interface javax.servlet.http.HttpServletResponse

containsHeader

public boolean containsHeader(java.lang.String name)
Not implemented. Always returns false.
Specified by:
containsHeader in interface javax.servlet.http.HttpServletResponse

encodeURL

public java.lang.String encodeURL(java.lang.String url)
Not implemented. Always returns url.
Specified by:
encodeURL in interface javax.servlet.http.HttpServletResponse

encodeRedirectURL

public java.lang.String encodeRedirectURL(java.lang.String url)
Not implemented. Always returns url.
Specified by:
encodeRedirectURL in interface javax.servlet.http.HttpServletResponse

encodeUrl

public java.lang.String encodeUrl(java.lang.String url)
Not implemented. Always returns encodeURL(url).
Specified by:
encodeUrl in interface javax.servlet.http.HttpServletResponse

encodeRedirectUrl

public java.lang.String encodeRedirectUrl(java.lang.String url)
Not implemented. Always returns encodeRedirectURL(url).
Specified by:
encodeRedirectUrl in interface javax.servlet.http.HttpServletResponse

sendError

public void sendError(int sc,
                      java.lang.String msg)
               throws java.io.IOException
Not implemented. The call is ignored.
Specified by:
sendError in interface javax.servlet.http.HttpServletResponse

sendError

public void sendError(int sc)
               throws java.io.IOException
Not implemented. The call is passed to sendError with the msg set to "".
Specified by:
sendError in interface javax.servlet.http.HttpServletResponse

sendRedirect

public void sendRedirect(java.lang.String location)
                  throws java.io.IOException
Not implemented. The call is ignored.
Specified by:
sendRedirect in interface javax.servlet.http.HttpServletResponse

setDateHeader

public void setDateHeader(java.lang.String name,
                          long date)
Not implemented. The call is ignored.
Specified by:
setDateHeader in interface javax.servlet.http.HttpServletResponse

addDateHeader

public void addDateHeader(java.lang.String name,
                          long date)
Not implemented. The call is ignored.
Specified by:
addDateHeader in interface javax.servlet.http.HttpServletResponse

setHeader

public void setHeader(java.lang.String name,
                      java.lang.String value)
Not implemented. The call is ignored.
Specified by:
setHeader in interface javax.servlet.http.HttpServletResponse

addHeader

public void addHeader(java.lang.String name,
                      java.lang.String value)
Not implemented. The call is ignored.
Specified by:
addHeader in interface javax.servlet.http.HttpServletResponse

setIntHeader

public void setIntHeader(java.lang.String name,
                         int value)
Not implemented. The call is ignored.
Specified by:
setIntHeader in interface javax.servlet.http.HttpServletResponse

addIntHeader

public void addIntHeader(java.lang.String name,
                         int value)
Not implemented. The call is ignored.
Specified by:
addIntHeader in interface javax.servlet.http.HttpServletResponse

setStatus

public void setStatus(int sc)
Not implemented. The call is ignored.
Specified by:
setStatus in interface javax.servlet.http.HttpServletResponse

setStatus

public void setStatus(int sc,
                      java.lang.String sm)
Not implemented. The call is ignored.
Specified by:
setStatus in interface javax.servlet.http.HttpServletResponse


Copyright © Droplets, 2001. All Rights Reserved.