views:

95

answers:

1

Getting the following error when loading the URL in the browser:

The XML page cannot be displayed

Invalid at the top level of the document. Error processing resource 'http://localhost:8080/AjaxDecoder/response'. Line 1, ...

Using Eclipse with Tomcat integrated. My web.xml file is:

<!DOCTYPE web-app
 PUBLIC  "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
 "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"&gt;
<web-app>
 <servlet>
    <servlet-name>AjaxResponseServlet</servlet-name>
    <servlet-class>AjaxResponseServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
 </servlet>
 <servlet-mapping>
    <servlet-name>AjaxResponseServlet</servlet-name>
    <url-pattern>/response</url-pattern>
 </servlet-mapping>
 <welcome-file-list>
 <welcome-file>index.html</welcome-file>
 </welcome-file-list>
</web-app>

Any idea what stupid thing I am doing? Seems there is something wrong with my web.xml configuration.

A: 

This code is working but if you are changing any parameters related servlet then you have to restart your server. Also check your AjaxResponseServlet path if it is any package then you have to change

enter code here <servlet-class>[Package name].AjaxResponseServlet</servlet-class>
Parag
Thanks. I do have a package and have it in the servlet-class now. I am still getting an error and the simple application is not working. I get INVALID_STATE_ERR: DOM Exception 11 when I execute the req.open(.
Don