Package org.jdesktop.http.async
Class XmlHttpRequest
java.lang.Object
org.jdesktop.beans.AbstractBean
org.jdesktop.http.async.AsyncHttpRequest
org.jdesktop.http.async.XmlHttpRequest
- All Implemented Interfaces:
Constants
Mimics the AJAX equivilent. The idea is that this class will
make a request and get as a response some valid XML.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jdesktop.http.async.AsyncHttpRequest
AsyncHttpRequest.AsyncWorker, AsyncHttpRequest.ReadyState -
Field Summary
Fields inherited from interface org.jdesktop.http.Constants
HDAER_FROM, HEADER_ACCEPT_CHARSET, HEADER_ACCEPT_ENCODING, HEADER_AUTHORIZATION, HEADER_CONTENT_BASE, HEADER_CONTENT_LENGTH, HEADER_CONTENT_LOCATION, HEADER_CONTENT_MD5, HEADER_CONTENT_RANGE, HEADER_CONTENT_TYPE, HEADER_CONTENT_VERSION, HEADER_DATE, HEADER_DELTA_BASE, HEADER_DEPTH, HEADER_DESTINATION, HEADER_E_TAG, HEADER_EXPECT, HEADER_HOST, HEADER_IF_MODIFIED_SINCE, HEADER_IF_RANGE, HEADER_IF_UNMODIFIED_SINCE, HEADER_KEEP_ALIVE, HEADER_MAX_FORWARDS, HEADER_MIME_VERSION, HEADER_OVERWRITE, HEADER_PROXY_AUTHORIZATION, HEADER_REFERER, HEADER_SOAP_ACTION, HEADER_TE, HEADER_TIMEOUT, HEADER_TRAILER, HEADER_TRANSFER_ENCODING, HEADER_UPGRADE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIf the readyState attribute has a value other than LOADED, then this method will return null.protected voidhandleResponse(String responseText)Method that provides a hook for subclasses to create concrete types (such as DOM, JSONObject, etc) when the response has been fully read.static voidstatic voidprintDocument(Document doc, OutputStream out)protected voidreset()Clears any response state and resets the readyState to UNINITIALIZED.Methods inherited from class org.jdesktop.http.async.AsyncHttpRequest
abort, addReadyStateChangeListener, createAsyncWorker, getAllResponseHeaders, getException, getFollowRedirects, getOnReadyStateChange, getParameter, getParameters, getPassword, getReadyState, getReadyStateChangeListeners, getResponseHeader, getResponseText, getSession, getStatus, getStatusText, getUsername, open, open, open, removeReadyStateChangeListener, send, send, send, setFollowsRedirects, setOnReadyStateChange, setParameter, setParameter, setParameters, setPassword, setRequestHeader, setSession, setUsernameMethods inherited from class org.jdesktop.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
-
Constructor Details
-
XmlHttpRequest
public XmlHttpRequest()Creates a new instance of XmlHttpRequest
-
-
Method Details
-
getResponseXML
If the readyState attribute has a value other than LOADED, then this method will return null. Otherwise, if the Content-Type contains text/xml, application/xml, or ends in +xml then a Document will be returned. Otherwise, null is returned. -
reset
protected void reset()Description copied from class:AsyncHttpRequestClears any response state and resets the readyState to UNINITIALIZED. Any overriding implementations MUST call super.reset() at the end of the implementation.- Overrides:
resetin classAsyncHttpRequest
-
handleResponse
Description copied from class:AsyncHttpRequestMethod that provides a hook for subclasses to create concrete types (such as DOM, JSONObject, etc) when the response has been fully read. There is no need to call super.handleResponse(txt).- Overrides:
handleResponsein classAsyncHttpRequest- Throws:
Exception
-
printDocument
public static void printDocument(Document doc, OutputStream out) throws IOException, TransformerException- Throws:
IOExceptionTransformerException
-
main
-