Not able to run the Servlet.....

sahilgandhi87

sahilgandhi87

@sahilgandhi87-jf94Wy Oct 25, 2024
System does not support the specified encoding. Error processing resource 'file:///C:/tomcat/webapps/ch1/WEB-INF/web.xml'. ...


<?xml version="1.0" encoding="ISO-8851-1" ?>


.......................

xml file:


<?xml version="1.0" encoding="ISO-8851-1" ?>
<web-app xmlns="https://java.sun.com/xml/ns/j2ee"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://java.sun.com/xml/ns/j2ee
https://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet>
<servlet-name>Chapter1 Servlet</servlet-name>
<servlet-class>Ch1Servlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Chapter1 Servlet</servlet-name>
<url-pattern>/Serv1</url-pattern>
</servlet-mapping>
</web-app>



......
How to get over this?




Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • shalini_goel14

    shalini_goel14

    @shalini-goel14-ASmC2J Apr 7, 2009

    Hey sahil from where you copied this xml file? Try following xml file if it works for you or better go for any sample web.xml provided in examples folder of Apache Tomcat(just search for it in your system)

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <![URL="https://www.adp-gmbh.ch/xml/dtd.html"][COLOR=#553333]DOCTYPE[/COLOR][/URL] web-app 
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
        "https://java.sun.com/dtd/web-app_2_3.dtd">
     
    <web-app>    
    [FONT=Verdana]<servlet>[/FONT]
    [FONT=Verdana]<servlet-name>Chapter1 Servlet</servlet-name>[/FONT]
    [FONT=Verdana]<servlet-class>Ch1Servlet</servlet-class>[/FONT]
    [FONT=Verdana]</servlet>[/FONT]
    [FONT=Verdana]<servlet-mapping>[/FONT]
    [FONT=Verdana]<servlet-name>Chapter1 Servlet</servlet-name>[/FONT]
    [FONT=Verdana]<url-pattern>/Serv1</url-pattern>[/FONT]
    [FONT=Verdana]</servlet-mapping>[/FONT]
    [FONT=Verdana]</web-app>  [/FONT]
    Try once with encoding="UTF-8" instead of "ISO-8859-1" in above file. Do let me know if still same issue

    Thanks