All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface org.apache.tomcat.core.Response

public interface Response
Author:
James Duncan Davidson [duncan@eng.sun.com], Jason Hunter [jch@eng.sun.com], James Todd [gonzo@eng.sun.com], Harish Prabandham, Hans Bergsten , costin@dnt.ro

Method Index

 o addCookie(Cookie)
 o addHeader(String, String)
 o containsHeader(String)
 o endHeaders()
Signal that we're done with the headers, and body will follow.
 o finish()
Signal that we're done with a particular request, the server can go on and read more requests or close the socket
 o flushBuffer()
Any implementation needs to notify ContextManger
 o getBufferSize()
 o getCharacterEncoding()
translate locale into encoding.
 o getContentLength()
 o getContentType()
 o getCookies()
 o getFacade()
One-to-one with Facade.
 o getLocale()
 o getOutputStream()
Either re-implement getOutputStream or return BufferedServletOutputStream(this) and implement doWrite();
 o getRequest()
 o getSessionId()
 o getStatus()
 o getWriter()
 o isBufferCommitted()
 o isIncluded()
True if we are in an included servlet
 o isStarted()
True if getOutputStream or getWriter was called.
 o isUsingStream()
True if getOutputStream was called.
 o recycle()
Response objects will be pool-able
 o reset()
 o setBufferSize(int)
 o setContentLength(int)
 o setContentType(String)
Set content type - this might also set encoding, if specified
 o setHeader(String, String)
 o setIncluded(boolean)
The response will not set any header or the status line - it can only write to the output stream or flush.
 o setLocale(Locale)
 o setRequest(Request)
One-to-one relation with Request
 o setSessionId(String)
Will set the session id.
 o setStatus(int)

Methods

 o containsHeader
 public abstract boolean containsHeader(String name)
 o setHeader
 public abstract void setHeader(String name,
                                String value)
 o addHeader
 public abstract void addHeader(String name,
                                String value)
 o endHeaders
 public abstract void endHeaders() throws IOException
Signal that we're done with the headers, and body will follow. Any implementation needs to notify ContextManager, to allow interceptors to fix headers.

 o isStarted
 public abstract boolean isStarted()
True if getOutputStream or getWriter was called. XXX change it to "if any output was writen" Used by RD.forward() and ServletWrapper.error()

 o isUsingStream
 public abstract boolean isUsingStream()
True if getOutputStream was called. Used to avoid the ugly try getWriter() catch getOutputStream.

 o finish
 public abstract void finish() throws IOException
Signal that we're done with a particular request, the server can go on and read more requests or close the socket

 o getOutputStream
 public abstract ServletOutputStream getOutputStream()
Either re-implement getOutputStream or return BufferedServletOutputStream(this) and implement doWrite();

 o getWriter
 public abstract PrintWriter getWriter() throws IOException
 o isIncluded
 public abstract boolean isIncluded()
True if we are in an included servlet

 o setIncluded
 public abstract void setIncluded(boolean b)
The response will not set any header or the status line - it can only write to the output stream or flush. This is used to implement RD.include() and can be used for HTTP/0.9

 o getBufferSize
 public abstract int getBufferSize()
 o setBufferSize
 public abstract void setBufferSize(int size) throws IllegalStateException
 o isBufferCommitted
 public abstract boolean isBufferCommitted()
 o reset
 public abstract void reset() throws IllegalStateException
 o flushBuffer
 public abstract void flushBuffer() throws IOException
Any implementation needs to notify ContextManger

 o addCookie
 public abstract void addCookie(Cookie cookie)
 o getCookies
 public abstract Enumeration getCookies()
 o getLocale
 public abstract Locale getLocale()
 o setLocale
 public abstract void setLocale(Locale locale)
 o getCharacterEncoding
 public abstract String getCharacterEncoding()
translate locale into encoding.

 o setContentType
 public abstract void setContentType(String contentType)
Set content type - this might also set encoding, if specified

 o getContentType
 public abstract String getContentType()
 o setContentLength
 public abstract void setContentLength(int contentLength)
 o getContentLength
 public abstract int getContentLength()
 o setStatus
 public abstract void setStatus(int status)
 o getStatus
 public abstract int getStatus()
 o setSessionId
 public abstract void setSessionId(String sId)
Will set the session id. The session interceptor might process it and add a Cookie header, and it can be used to rewrite URLs. This replace "system cookies" ( it was the only use for them )

 o getSessionId
 public abstract String getSessionId()
 o getFacade
 public abstract HttpServletResponseFacade getFacade()
One-to-one with Facade. You can use HttpResponseFacade.

 o setRequest
 public abstract void setRequest(Request request)
One-to-one relation with Request

 o getRequest
 public abstract Request getRequest()
 o recycle
 public abstract void recycle()
Response objects will be pool-able


All Packages  Class Hierarchy  This Package  Previous  Next  Index