|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mortbay.http.handler.AbstractHttpHandler ccs.http.AbstractXhtmlHandler
public abstract class AbstractXhtmlHandler
Infrastructure to handle XHTML correctly. In subclasses, all content should
be returned using sendBuffer
. All HTML should be typed as
text/html
. This class deals with retyping XHTML correctly
for browsers which support it.
Nested Class Summary | |
---|---|
protected static class |
AbstractXhtmlHandler.XHMode
|
Field Summary | |
---|---|
static boolean |
isEnabled
Whether to enable rigorous XHTML handling. |
protected MimeRegProvider |
mrp
|
Constructor Summary | |
---|---|
AbstractXhtmlHandler(MimeRegProvider mrp)
Ctor. |
Method Summary | |
---|---|
protected abstract AbstractXhtmlHandler.XHMode |
getDefaultXHMode()
The XHTML handling mode to use if no request-specific handling mode has been set. |
protected boolean |
isXhtmlUA(org.mortbay.http.HttpRequest ha)
|
protected void |
makeUncacheable(org.mortbay.http.HttpResponse hq)
Utility method. |
protected void |
sendBuffer(java.lang.String objectID,
SwappingBuffer q,
org.mortbay.http.HttpRequest ha,
org.mortbay.http.HttpResponse hq)
Send back a filled SwappingBuffer. |
protected void |
sendCDBFile(CDBeeTree cdb,
java.lang.String internalPath,
org.mortbay.http.HttpRequest ha,
org.mortbay.http.HttpResponse hq)
Send back a CDBFile, using either sendBuffer or
sendStream depending on size. |
protected void |
sendStream(java.lang.String objectID,
CallbackStreamProducer src,
java.lang.String mimeType,
org.mortbay.http.HttpRequest ha,
org.mortbay.http.HttpResponse hq)
Send back a stream via a stream-producer / stream-consumer callback. |
protected void |
setXHMode(AbstractXhtmlHandler.XHMode mode,
org.mortbay.http.HttpResponse hq)
Set a request-specific XHTML handling mode for this request (if different from the default for this handler.) |
Methods inherited from class org.mortbay.http.handler.AbstractHttpHandler |
---|
getHttpContext, getName, handleTrace, initialize, isStarted, setName, start, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.mortbay.http.HttpHandler |
---|
handle |
Field Detail |
---|
public static final boolean isEnabled
protected MimeRegProvider mrp
Constructor Detail |
---|
public AbstractXhtmlHandler(MimeRegProvider mrp)
mrp
- provides the MimeRegistry to be used by sendBuffer
to determine the correct MIME type of buffers which don't specify their own
MIME type. If null, a default provider will be used.Method Detail |
---|
protected abstract AbstractXhtmlHandler.XHMode getDefaultXHMode()
protected final void setXHMode(AbstractXhtmlHandler.XHMode mode, org.mortbay.http.HttpResponse hq)
protected void makeUncacheable(org.mortbay.http.HttpResponse hq)
hq
- The response to make cache-proof.protected void sendBuffer(java.lang.String objectID, SwappingBuffer q, org.mortbay.http.HttpRequest ha, org.mortbay.http.HttpResponse hq) throws java.io.IOException
objectID
- The Object ID for the object in the buffer. This is
used to determine the MIME type, iff one is not supplied in...q
- The buffer to send.ha
- The request to which this is a response. Used mostly for
XHTML handling.hq
- The response to send to.
java.io.IOException
protected boolean isXhtmlUA(org.mortbay.http.HttpRequest ha)
protected void sendStream(java.lang.String objectID, CallbackStreamProducer src, java.lang.String mimeType, org.mortbay.http.HttpRequest ha, org.mortbay.http.HttpResponse hq) throws java.io.IOException
sendBuffer
does.
objectID
- The Object ID for the object in the buffer. This is
used to determine the MIME type, iff mimeType
is null.src
- The stream producer which will conjure up the stream we're to send.mimeType
- The required MIME type of the stream, if known a priori.
Usually, it won't be, in which case supply null and the method will work it
out from the objectID
.ha
- The request to which this is a response. Not currently used, but
supply it anyway (this might change in future).hq
- The response to send to.
java.io.IOException
protected void sendCDBFile(CDBeeTree cdb, java.lang.String internalPath, org.mortbay.http.HttpRequest ha, org.mortbay.http.HttpResponse hq) throws java.io.IOException
sendBuffer
or
sendStream
depending on size.
cdb
- The CDBeeTree containing the file.internalPath
- The path (key) of the CDBFile within the CDB filesystem.ha
- The request.hq
- The response.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |