CrazyEngineers
  • Not able to run the Servlet.....

    Updated: Oct 25, 2024
    Views: 1.1K
    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?




    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • shalini_goel14

    MemberApr 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
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register