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 what can i do with web.xml? 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 "what can i do with web.xml?" Watch "what can i do with web.xml?" New topic
Author

what can i do with web.xml?

Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 928
what can i do with web.xml??
i mean what-what things i can do with web.xml??
and can i use annotations instead of web.xml?
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4634
    
    5

Can you rephrase the question? What are you asking?

In general, you *have* to use web.xml. You don't have a choice. You use it to declare key aspects of your web application.
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 928
we give the <url-pattern> of our servlet in web.xml, and i read somewhere that we can also give this into the servlet itself using annotations, and we can easily change the url-pattern from class itself, no need to go for web.xml..

also i want to know what other things i can do in web.xml??
(ie. we can do error handling.)
prateek shaw
Greenhorn

Joined: Jun 16, 2008
Posts: 2
For J2EE application web.xml is vital part.And also it is not possible to explain all things because it is depends on situation.but some part i would like explain here

1-par application should have one web.xml file.
2-you can able to define the welcome pages.
3-when server going to deployed any J2EE application it will look for only web.xml first
3-all Servlet entry should we present in this file
4-you can also add filter class
5.you can also mentioned dependency.
6-Secutiry
7-EJB reference
8-Tag Library
9-Message Destination
10-Session time out
11-Error pages

and also many more .i would like to recommend the Head first servlet and jsp .

Thanks
Prateek
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 928
okay...thank you...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what can i do with web.xml?
 
Similar Threads
unknown element `xsi:schemaLocation' in web-app
web.xml vs sun-web.xml
Interview question
error message
Hide the whole URL from the User