aspose file tools*
The moose likes Tomcat and the fly likes Unable to Run a Servlet in Apache Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Unable to Run a Servlet in Apache Tomcat" Watch "Unable to Run a Servlet in Apache Tomcat" New topic
Author

Unable to Run a Servlet in Apache Tomcat

Silvester Stalin Bruno
Greenhorn

Joined: Aug 16, 2007
Posts: 3
I am trying to run a servlet in Apache Tomcat. But, it's not working.

I followed the steps given in Head First Servlet and JSP.
1. I created a folder ch1 under Tomcat/webapps
2. I placed my servlet class under ch1/WEB-INF/classes
3. I placed web.xml file under ch1/WEB-INF.

<?xml version="1.0" encoding="ISO-8851-1" ?>
<web-app xmlns="http://www.sun.java.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sun.java.com/xml/ns/j2ee
http://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>

But, when i try hitting the page http://localhost:8080/ch1/Serv1, i get IE can not display the page.

Please advise, if i missed anything.

I am running Tomcat5 service in Windows Vista. And i have tomcat in "C:\Program Files\Apache Software Foundation\Tomcat".
Silvester Stalin Bruno
Greenhorn

Joined: Aug 16, 2007
Posts: 3
Hi all,

It's working now.

I changed the encoding value in web.xml to "ISO-8859-1" from "ISO-8851-1"
<?xml version="1.0" encoding="ISO-8859-1"?>

Thanks,
Stalin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to Run a Servlet in Apache Tomcat