Index: src/edu/ucsb/nceas/metacat/MetaCatServlet.java
===================================================================
--- src/edu/ucsb/nceas/metacat/MetaCatServlet.java	(revision 58)
+++ src/edu/ucsb/nceas/metacat/MetaCatServlet.java	(revision 59)
@@ -14,6 +14,7 @@
 import java.io.IOException;
 import java.io.Reader;
 import java.io.StringReader;
+import java.io.BufferedReader;
 import java.util.Enumeration;
 import java.util.Hashtable;
 import java.net.URL;
@@ -87,12 +88,8 @@
   public void doGet (HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
 
-    // Get the parameters from the form
-    String querystring = request.getQueryString();
-    Hashtable params = HttpUtils.parseQueryString(querystring);
-
     // Process the data and send back the response
-    handleGetOrPost(response, params);
+    handleGetOrPost(request, response);
   }
 
   /** Handle "POST" method requests from HTTP clients */
@@ -99,26 +96,30 @@
   public void doPost( HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
 
-    // Get the input data from the client
-    ServletInputStream in = request.getInputStream();
-    int len = request.getContentLength();
-
-    // Parse the input data into a Hashtable
-    Hashtable params = HttpUtils.parsePostData(len, in);
-
     // Process the data and send back the response
-    handleGetOrPost(response, params);
+    handleGetOrPost(request, response);
   }
 
   /**
    * Control servlet response depending on the action parameter specified
    */
-  private void handleGetOrPost(HttpServletResponse response, Hashtable params) 
+  private void handleGetOrPost(HttpServletRequest request, 
+    HttpServletResponse response) 
     throws ServletException, IOException {
 
     // Get a handle to the output stream back to the client
     PrintWriter out = response.getWriter();
   
+    String name = null;
+    String[] value = null;
+    Hashtable params = new Hashtable();
+    Enumeration paramlist = request.getParameterNames();
+    while (paramlist.hasMoreElements()) {
+      name = (String)paramlist.nextElement();
+      value = request.getParameterValues(name);
+      params.put(name,value);
+    }
+
     String action = ((String[])params.get("action"))[0];
 
     if (action.equals("query")) {
@@ -203,23 +204,25 @@
    */
   private void handlePutDocumentAction(PrintWriter out, Hashtable params, 
                HttpServletResponse response) {
+
       // Get the document indicated
-      String doctext = ((String[])params.get("doctext"))[0]; 
-      StringReader xml = new StringReader(doctext);
+      String[] doctext = (String[])params.get("doctext");
+      StringReader xml = new StringReader(doctext[0]);
+
+      // write the document to the database
       try {
-        DBSAXWriter dbw = new DBSAXWriter(doctext, conn);
+        DBSAXWriter dbw = new DBSAXWriter(xml, conn);
       } catch (SQLException e1) {
-          out.println("Error loading document:<p>\n" + e1.getMessage());
+          out.println("Error 1 loading document:<p>\n" + e1.getMessage());
       }catch (IOException e2) {
-          out.println("Error loading document:<p>\n" + e2.getMessage());
+          out.println("Error 2 loading document:<p>\n" + e2.getMessage());
       }catch (ClassNotFoundException e3) {
-          out.println("Error loading document:<p>\n" + e3.getMessage());
+          out.println("Error 3 loading document:<p>\n" + e3.getMessage());
       }
-      //String doc = docreader.readXMLDocument((new Long(docid)).longValue());
 
       // set content type and other response header fields first
-      response.setContentType("text/html");
+      response.setContentType("text/xml");
   
-      out.println("Finished loading document.");
+      out.println(doctext[0]);
   }
 }
Index: MetaCatServlet.java
===================================================================
--- MetaCatServlet.java	(revision 58)
+++ MetaCatServlet.java	(revision 59)
@@ -14,6 +14,7 @@
 import java.io.IOException;
 import java.io.Reader;
 import java.io.StringReader;
+import java.io.BufferedReader;
 import java.util.Enumeration;
 import java.util.Hashtable;
 import java.net.URL;
@@ -87,12 +88,8 @@
   public void doGet (HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
 
-    // Get the parameters from the form
-    String querystring = request.getQueryString();
-    Hashtable params = HttpUtils.parseQueryString(querystring);
-
     // Process the data and send back the response
-    handleGetOrPost(response, params);
+    handleGetOrPost(request, response);
   }
 
   /** Handle "POST" method requests from HTTP clients */
@@ -99,26 +96,30 @@
   public void doPost( HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
 
-    // Get the input data from the client
-    ServletInputStream in = request.getInputStream();
-    int len = request.getContentLength();
-
-    // Parse the input data into a Hashtable
-    Hashtable params = HttpUtils.parsePostData(len, in);
-
     // Process the data and send back the response
-    handleGetOrPost(response, params);
+    handleGetOrPost(request, response);
   }
 
   /**
    * Control servlet response depending on the action parameter specified
    */
-  private void handleGetOrPost(HttpServletResponse response, Hashtable params) 
+  private void handleGetOrPost(HttpServletRequest request, 
+    HttpServletResponse response) 
     throws ServletException, IOException {
 
     // Get a handle to the output stream back to the client
     PrintWriter out = response.getWriter();
   
+    String name = null;
+    String[] value = null;
+    Hashtable params = new Hashtable();
+    Enumeration paramlist = request.getParameterNames();
+    while (paramlist.hasMoreElements()) {
+      name = (String)paramlist.nextElement();
+      value = request.getParameterValues(name);
+      params.put(name,value);
+    }
+
     String action = ((String[])params.get("action"))[0];
 
     if (action.equals("query")) {
@@ -203,23 +204,25 @@
    */
   private void handlePutDocumentAction(PrintWriter out, Hashtable params, 
                HttpServletResponse response) {
+
       // Get the document indicated
-      String doctext = ((String[])params.get("doctext"))[0]; 
-      StringReader xml = new StringReader(doctext);
+      String[] doctext = (String[])params.get("doctext");
+      StringReader xml = new StringReader(doctext[0]);
+
+      // write the document to the database
       try {
-        DBSAXWriter dbw = new DBSAXWriter(doctext, conn);
+        DBSAXWriter dbw = new DBSAXWriter(xml, conn);
       } catch (SQLException e1) {
-          out.println("Error loading document:<p>\n" + e1.getMessage());
+          out.println("Error 1 loading document:<p>\n" + e1.getMessage());
       }catch (IOException e2) {
-          out.println("Error loading document:<p>\n" + e2.getMessage());
+          out.println("Error 2 loading document:<p>\n" + e2.getMessage());
       }catch (ClassNotFoundException e3) {
-          out.println("Error loading document:<p>\n" + e3.getMessage());
+          out.println("Error 3 loading document:<p>\n" + e3.getMessage());
       }
-      //String doc = docreader.readXMLDocument((new Long(docid)).longValue());
 
       // set content type and other response header fields first
-      response.setContentType("text/html");
+      response.setContentType("text/xml");
   
-      out.println("Finished loading document.");
+      out.println(doctext[0]);
   }
 }
Index: loadxml.html
===================================================================
--- loadxml.html	(revision 58)
+++ loadxml.html	(revision 59)
@@ -17,17 +17,14 @@
 <body bgcolor="white">
 <b>MetaCat XML Loader</b>
 <p>
-Load an XML document into MetaCat<br>
-by pasting the XML into this box.<br>
+Load an XML document into MetaCat by pasting the XML into this box.
+</p>
 <form action="/servlets/MetaCatServlet" target="right" method="POST">
   <input type="hidden" name="action" value="putdocument">
-  <textarea name="doctext" size="50"></textarea>
+  <textarea name="doctext" cols="55" rows="15"></textarea>
+  <br />
   <input type="submit" value="Load XML">
 </form>
-<p>
-To view results that are XML formatted in this demo, it is easiest to use 
-Internet Explorer 5. Although Netscape browsers will allow you to 
-download XML documents, only IE5 will display XML at this time.
-<p>
+<p />
 </body>
 </html>
Index: lib/loadxml.html
===================================================================
--- lib/loadxml.html	(revision 58)
+++ lib/loadxml.html	(revision 59)
@@ -17,17 +17,14 @@
 <body bgcolor="white">
 <b>MetaCat XML Loader</b>
 <p>
-Load an XML document into MetaCat<br>
-by pasting the XML into this box.<br>
+Load an XML document into MetaCat by pasting the XML into this box.
+</p>
 <form action="/servlets/MetaCatServlet" target="right" method="POST">
   <input type="hidden" name="action" value="putdocument">
-  <textarea name="doctext" size="50"></textarea>
+  <textarea name="doctext" cols="55" rows="15"></textarea>
+  <br />
   <input type="submit" value="Load XML">
 </form>
-<p>
-To view results that are XML formatted in this demo, it is easiest to use 
-Internet Explorer 5. Although Netscape browsers will allow you to 
-download XML documents, only IE5 will display XML at this time.
-<p>
+<p />
 </body>
 </html>
