Hello, I am trying to parse xml sent via HTTP within a
servlet. I've created a class, Echo, which handles the parsing of the data. I call the Echo class from my servlet, providing it the xml data. I am getting the following error message when I compile:
cannot resolve symbol
symbol : constructor Echo ()
location: class Echo
DefaultHandler handler = new Echo();
Anyone have any idea how I can resolve this error?
Here is my code:
import java.io.*;
import java.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class GreetingServlet extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
String DATA = request.getParameter("DATA");
if(DATA != null){
Echo pXML = new Echo(DATA);
}
}
}
import java.io.*;
import org.xml.sax.*;
import org.xml.sax.helpers.DefaultHandler;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
public class Echo extends DefaultHandler
{
public Echo(String instring)
{
// Use an instance of ourselves as the SAX event handler
DefaultHandler handler = new Echo();
....
}