This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "about web.xml file." Watch "about web.xml file." New topic
Author

about web.xml file.

sharma anurag
Greenhorn

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
Bartender

Joined: Oct 02, 2003
Posts: 10911
    
  12

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
Sheriff

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
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

The article Ben mentioned.

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: about web.xml file.
 
Similar Threads
cannot find servlet - errors
Servlet mapping
Exact Front Controller In Realtime
How to run servlet on Weblogic 6.0
The requested resource (/servlet/LoginServlet) is not available