Class XmlHttpRequest

All Implemented Interfaces:
Constants

public class XmlHttpRequest extends AsyncHttpRequest
Mimics the AJAX equivilent. The idea is that this class will make a request and get as a response some valid XML.
  • Constructor Details

    • XmlHttpRequest

      public XmlHttpRequest()
      Creates a new instance of XmlHttpRequest
  • Method Details

    • getResponseXML

      public final SimpleDocument 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: AsyncHttpRequest
      Clears any response state and resets the readyState to UNINITIALIZED. Any overriding implementations MUST call super.reset() at the end of the implementation.
      Overrides:
      reset in class AsyncHttpRequest
    • handleResponse

      protected void handleResponse(String responseText) throws Exception
      Description copied from class: AsyncHttpRequest
      Method 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:
      handleResponse in class AsyncHttpRequest
      Throws:
      Exception
    • printDocument

      public static void printDocument(Document doc, OutputStream out) throws IOException, TransformerException
      Throws:
      IOException
      TransformerException
    • main

      public static void main(String[] args)