File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes about web.xml file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "about web.xml file." Watch "about web.xml file." New topic

about web.xml file.

sharma anurag

Joined: Aug 29, 2007
Posts: 16
hi to all my friends of javaranch.!!

i want to know that if i am creating servlet so for that i have to write respective web.xml file also from which the server gets the information about my servlet right.
I want to know that for every servlet i have to write the this following lines of code right.

ok so i want to know that will my above code is right or not??? please help me out from this .... and please give the correct coding also for this above web.xml ok.

Thanks in advance.!!!

[BPSouther: Added code tags]
[ September 06, 2007: Message edited by: Ben Souther ]
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

I'm going to move this to our servlets forum

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

At a glance, your deployment descriptor (web.xml file) looks fine.

If you want to avoid the need to configure a servlet for each and every component you write, look up the Front Controller or Command pattern.

We have an example in our code barn under Servlets.
Also Bear Bibeault has written an article in our Journal about the front controller pattern as used by his FrontMan framework.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

The article Ben mentioned.

Also, an implementation of Front Man is available. Click on link in my sig.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: about web.xml file.
It's not a secret anymore!