I am trying to run the code I copied from

http://developer.java.sun.com/developer/qow/archive/84/index.html

under iPlanet.

I can compile the two files, but I get a run time error in the iPlanet
server's error log.

Unable to locate class: XmlServlet (java.lang.NoClassDefFoundError:
XmlServlet (wrong name: XmlBridge))
Internal error: Failed to get GenericServlet.
(uri=/servlet/XmlServlet,SCRIPT_NAME=/servlet/XmlServlet).


Also, look at the code for the XmlServlet shown below, I don't understand
the line : protected abstract Document doRequest(Document req);
since it does not have a body. I am not a newbie at servlet but I am not
very
familier with it.

Anyone can help?

Thanks.


Jennifer


===== XmlServlet.java======

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import org.apache.xerces.*;
import org.apache.xerces.dom.*;
import org.apache.xerces.parsers.*;
import org.apache.xml.serialize.*;

public abstract class XmlServlet
extends GenericServlet {
  protected abstract Document
  doRequest(Document req);
  public XmlServlet() {}
  public void service(ServletRequest req, ServletResponse res)
       throws ServletException
  {
    try {
      DOMParser parser =
     new DOMParser();
      parser.parse(new InputSource(req.getInputStream()));
      Document docOut = doRequest(parser.getDocument());
      XMLSerializer ser =
     new XMLSerializer(res.getOutputStream(),
                 new OutputFormat("xml","UTF-8", false));
      ser.serialize(docOut);
      res.getOutputStream().close();
    } catch (Throwable e)
      {
     e.printStackTrace();
      }
  }
}

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to