Project

General

Profile

« Previous | Next » 

Revision 102

Added by Matt Jones about 24 years ago

debugging form submission

View differences:

MetaCatServlet.java
159 159

  
160 160
    // Get a handle to the output stream back to the client
161 161
    PrintWriter out = response.getWriter();
162
    //response.setContentType("text/html");
162 163
  
163 164
    String name = null;
164 165
    String[] value = null;
......
167 168
    while (paramlist.hasMoreElements()) {
168 169
      name = (String)paramlist.nextElement();
169 170
      value = request.getParameterValues(name);
171
      //out.println(name + " => " + value[0]);
170 172
      params.put(name,value);
171 173
    }
172 174

  
......
264 266
  private void handleGetDocumentAction(PrintWriter out, Hashtable params, 
265 267
               HttpServletResponse response) 
266 268
               throws ClassNotFoundException, IOException, SQLException {
269
    String docidstr = null;
270
    long docid = 0;
271
    String doc = null;
272
    try {
267 273
      // Find the document id number
268
      String docidstr = ((String[])params.get("docid"))[0]; 
269
      long docid = (new Long(docidstr)).longValue();
274
      docidstr = ((String[])params.get("docid"))[0]; 
275
      docid = (new Long(docidstr)).longValue();
270 276

  
271 277
      // Get the document indicated fromthe db
272
      String doc = docreader.readXMLDocument(docid);
278
      doc = docreader.readXMLDocument(docid);
279
    } catch (NullPointerException npe) {
280
      response.setContentType("text/html");
281
      out.println("Error getting document ID: " + docidstr +" (" + docid + ")");
282
    }
273 283

  
274

  
275 284
      // Return the document in XML or HTML format
276 285
      String qformat = ((String[])params.get("qformat"))[0]; 
277 286
      if (qformat.equals("xml")) {

Also available in: Unified diff