aspose file tools*
The moose likes Servlets and the fly likes Doubt Regarding Web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Doubt Regarding Web.xml" Watch "Doubt Regarding Web.xml" New topic
Author

Doubt Regarding Web.xml

Nittin singla
Greenhorn

Joined: Jul 02, 2011
Posts: 24
Suppose i am working on some large application including thousands of servlets. Do i need to write each of these in the Deployment Descriptor file(Web.xml)?? Isnt there some shortcut to it?
Martyn Clark
Ranch Hand

Joined: Apr 16, 2005
Posts: 108
Which version of Servlets are you using if you use 3.0 you can configure mappings with annotations :-)


Martyn...<br /> <br />SCJP 1.4 SCWCD 1.4
Nittin singla
Greenhorn

Joined: Jul 02, 2011
Posts: 24
No...I am using the older version...
elvadas nono
Greenhorn

Joined: Jul 04, 2011
Posts: 12
Oups, I think with older version you should put all sevlet instances that the container should load in the deployment descriptors.
With servlet 3.0 API you can use Annotations, Web Fragments to reduce web.xml size,
you can also add servlet programmatically using new feartures of servletContext addServlet( String name, String class) etc..
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

A better solution could be using a MVC web framework like Struts2, Spring MVC, Stripes or FrontMan.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Please read this article for information on a patter that can help.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt Regarding Web.xml
 
Similar Threads
where to start..
is sibling elements in web.xml ordered?
can anyone give me the session time out example code
Problems with Tomcat & Struts
An Error Occured while starting tomcat