• Post Reply Bookmark Topic Watch Topic
  • New Topic

multiple deployment descriptor (web.xml) for one application

 
atool pune
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we have multiple deployment descriptor (web.xml) for one application...
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.

Why would need more than one?
 
Praison Selvaraj
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is possible in a way, with Servlet 3.0. The Servlet 3.0 specs allows you to define another file called web-fragment.xml whose content is same as that of web.xml

Please refer to
http://blogs.sun.com/swchan/entry/servlet_3_0_web_fragment

for details.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The ability to segment it out is not the same as having multiple descriptors. I'm still waiting to hear why the question is asked.
 
Praison Selvaraj
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's an extract from the link mentioned above:

"The content of web.xml and web-fragment.xml are almost the same. One can define servlets, filters and listeners there."

In essence it is as good as having separate "web.xmls" (the name of the file and its location are different though)
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again, it depends upon why the question was asked.
 
Kam Eley
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, a useful context I saw this is a "very nice to have" was while working in a department that supported various lines of business (LOBs). There was tons of configuration for each LOBs web application. Separating out each LOBs configuration into it's own deployment descriptor (well the framework was Struts and each application had it's own struts-config.xml) made it easier to manage and work between each LOB.

If an application is partioned employing it's own framework of mini "servlet" applications for example. that had it's own unique configuration it might well be advisable to separate out the configuration into their own deployment descriptors to make it easier to work with. Just a thought.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35709
410
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends how you are defining application. An enterprise application archive (ear) can have multiple web application archives (wars). And eash war gets its own web.xml.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!