|
Enhydra 3.1.1b1 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.xml.xmlc.servlet.XMLCContext
Class to facility the use of XMLC in a HTTP servlet. This object contains a XMLC factory to create instances of XMLC document classes and methods to output documents.
An instance of this object is associated with the ServletContext object for an application (one per WebApp). The object is created on first use by ({@see #getContext getContext}. It provides a factory for creating XMLC document class with optional automatic reloading of out of date classes or recompilation and reloading of classes out-of-date relative to a source file. Also provided are methods to output a XMLC document as a HTTP response, with automatic setting of response content type.
Instance of this class are configured using the following Servlet context-wide init parameters:
ServletContext
Inner Class Summary | |
static class |
XMLCContext.SessionURLEncodingMode
Enumerated constant indicating how URL session encoding is to be handled. |
Field Summary | |
static java.lang.String |
CONTEXT_ATTRIBUTE
Name of ServletContext attribute that contains the instance of this class for a WebApp. |
static XMLCContext.SessionURLEncodingMode |
URL_ENCODING_ALWAYS
Value indicating that URL session encoding should always be used. |
static XMLCContext.SessionURLEncodingMode |
URL_ENCODING_AUTO
Value indicating that URL session encoding should be detected automatically based on if it was used for the current requested. |
static XMLCContext.SessionURLEncodingMode |
URL_ENCODING_NEVER
Value indicating that URL session encoding should never be used. |
Method Summary | |
OutputOptions |
createOutputOptions(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
XMLObject document)
Create an OutputOptions object for a document. |
static XMLCContext |
getContext(javax.servlet.http.HttpServlet servlet)
Obtain the XMLCContext for the current application, creating it if it doesn't exist. |
XMLCContext.SessionURLEncodingMode |
getSessionURLEncoding()
|
XMLCFactory |
getXMLCFactory()
Get the XMLC factory object associated with the context. |
void |
setSessionURLEncoding(XMLCContext.SessionURLEncodingMode mode)
Set the session URL encoding mode. |
void |
setXMLCFactory(XMLCFactory factory)
Explictly set XMLC factory. |
void |
writeDOM(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
OutputOptions outputOptions,
XMLObject document)
Output an an XMLC document object (DOM). |
void |
writeDOM(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
XMLObject document)
Output an an XMLC document object (DOM). |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final XMLCContext.SessionURLEncodingMode URL_ENCODING_AUTO
public static final XMLCContext.SessionURLEncodingMode URL_ENCODING_ALWAYS
public static final XMLCContext.SessionURLEncodingMode URL_ENCODING_NEVER
public static final java.lang.String CONTEXT_ATTRIBUTE
Method Detail |
public XMLCFactory getXMLCFactory()
public void setXMLCFactory(XMLCFactory factory)
public void setSessionURLEncoding(XMLCContext.SessionURLEncodingMode mode)
mode
- Constant indicating what mode to useXMLCContext.SessionURLEncodingMode
public XMLCContext.SessionURLEncodingMode getSessionURLEncoding()
public OutputOptions createOutputOptions(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, XMLObject document)
The following attributes are set in the object:
request
- The servlet request object. The request is required
to determine if URL encoding should be done on the document.response
- The servlet response object. The response is required
to set up the URL encoder.document
- The DOM object to be returned as response.public void writeDOM(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, OutputOptions outputOptions, XMLObject document) throws java.io.IOException
request
- The servlet request object. The request is required
to determine if URL encoding should be done on the document.response
- The servlet response object. The
Content-Type and Content-Length will be set from
the document..outputFormat
- Object use to specify options controlling the
formatting of the document.document
- The DOM object to be returned as response.public void writeDOM(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, XMLObject document) throws java.io.IOException
request
- The servlet request object. The request is required
to determine if URL encoding should be done on the document.response
- The servlet response object. The
Content-Type and Content-Length will be set from
the document..document
- The DOM object to be returned as response.public static XMLCContext getContext(javax.servlet.http.HttpServlet servlet)
servlet
- A servlet in the application. The class loader that loaded this
servlet will be used to load XMLC document classes.
|
Enhydra 3.1.1b1 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |