开发者

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

开发者 https://www.devze.com 2023-01-09 03:02 出处:网络
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://localhos

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">
<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.


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>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号