Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java Open Source > Apache Tomcat
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Apache Tomcat General discussion of the Apache Tomcat servlet container. For discussions specific to the Professional Apache Tomcat book, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 26th, 2003, 12:56 PM
Registered User
 
Join Date: Dec 2003
Location: mumbai, maharashtra, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default not able to find classfile mapping through web.xml

Hi,
   I have written a servlet program named ContextServlet that will dislay on the output

out.println("<html>");
out.println("<head><title>Context Servlet</title></head>");
out.println("<body>");
out.println("</body></html>");

This servlet class file is in

....webapps\ch02app\web-inf\classes\chapter2 directory.

The web.xml file for this is

<?xml version="1.0" encoding="ISO-8859-1 "?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<servlet>
<servlet-name>ContextServlet</servlet-name>
<servlet-class>chapter2.ContextServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>ContextServlet</servlet-name>
<url-pattern>context</url-pattern>
</servlet-mapping>
</web-app>

This web.xml is in web-inf folder. I am trying to execute this servlet by giving the following URL in Netscape7/IE browser
        http://localhost:8080/ch02app/context

But I am getting the following error message
   HTTP Status 404 - /context
   The requested resource (/context) is not available.

I am using tomcat4 and jdk1.3 on Windows 98.

Is there any CLASSPATH setting required. If so where and what do I set it. Is the web.xml correct. How do I know whether it is getting parsed and if not, is a special parser required?? Each time I have changed web.xml I have bounced the tomcat server. I have added a CLASSPATH for my servlet in autoexec.bat and have restarted my machine. I dont know what else to do. Please advice. Mail to winnithr@yahoo.com

Best Regards,
Winnith
Reply With Quote
  #2 (permalink)  
Old January 2nd, 2004, 02:07 AM
Registered User
 
Join Date: Jan 2004
Location: NanJing, , China.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have the same trouble.But I think you could try by changing the fold name "web-inf" to "WEB-INF".

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I find the codes of this book on your web? smilepww C# 0 August 19th, 2005 01:46 AM
mapping repeating xml structure to flat csv f vasmallela Biztalk 0 May 29th, 2005 11:53 PM
Where can I find the code of C# Web Services? herostone All Other Wrox Books 2 November 8th, 2004 08:54 AM
Get Servlet without mapping in web.xml Abhijitsaha2000 Servlets 1 August 9th, 2004 04:17 AM
XML to (different <tag>) XML mapping Thodoris XML 4 April 27th, 2004 04:02 AM



All times are GMT -4. The time now is 12:14 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.