File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Servlet's web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Watch "Servlet New topic

Servlet's web.xml

Gaurav Chhabras
Ranch Hand

Joined: Sep 21, 2005
Posts: 126

I have created one servlet named firstServlet and put it in package com.mail
in web.xml i have written


but when i run that , then it will give the error that page not found.

Please rectify me.

Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Could you please also post your <servlet-mapping> ?

[My Blog]
All roads lead to JavaRanch
Nirav Patel

Joined: May 27, 2005
Posts: 22
Also, It's good practice to start java class with Capital letter. Like "FirstServlet". Only package names should start with small letter.

Just a code convention; good practice

----<br />Nirav Patel<br />Software is the bottleneck in the digital world!
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Nirav Patel:
Only package names should start with small letter.

Its better and correct if we say, every word in a class name should start with a capital letter, according to naming convention. e.g. FirstServlet, LastFilter. . . etc.
Leslic Chan

Joined: Nov 21, 2005
Posts: 2
you should add this

<servlet-name>your class</servlet-name>
Don't get me started about those stupid light bulbs.
subject: Servlet's web.xml
jQuery in Action, 3rd edition