• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Split web.xml into smaller manageable xml files

 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

For projects that have big web.xml and many developers working on it, is it possible to split it into smaller separate manageable XML files? I tried using the <!ENTITY filter SYSTEM "filter.xml"> to replace my <filter> tags but gotten parser errors.

Anyone done something of this before? Is it feasible?

Many thanks!
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nope, I don't think that you can split the Deployment Descriptor.
 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Chengwei Lee:
Hi all,

For projects that have big web.xml and many developers working on it, is it possible to split it into smaller separate manageable XML files? I tried using the <!ENTITY filter SYSTEM "filter.xml"> to replace my <filter> tags but gotten parser errors.

Anyone done something of this before? Is it feasible?

Many thanks!




Hi,
I have split the struts-config.xml file into 2 files like this

In struts-config.xml use

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"http://struts.apache.org/dtds/struts-config_1_2.dtd"[

<!ENTITY actions SYSTEM "actions.xml">

]>

<!-- =============== Mappings in actions.xml ===================== -->
&actions;

and actions.xml is a normal xml file.

Use this to split web.xml. I have never tested it with web.xml so tell me if it works.

Regards,
Praveen
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Praveen,

Thanks for the example, seems that Satou is right, the DD cannot be splitted. Tried following your example to breakdown the web.xml but the server complained malformed XML.

Cheers!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the web.xml is so big because you have many individual servlet definitions, your app could benefit from using a Front Controller. Please read this article for more information.
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bear Bibeault:
If the web.xml is so big because you have many individual servlet definitions, your app could benefit from using a Front Controller. Please read this article for more information.



I know what you mean, unfortunately it's a live application and any major refactoring work has to be done in small incremental stages. A front controller is what we're working towards, but meanwhile, it would be good if we could breakdown the web.xml.

 
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can split the web.xml into smaller manageable files:


<?xml versionfiltered="1.0" standalone="no"?>
<!DOCTYPE webapp [
<!ENTITY servlets SYSTEM "servlets.xml">
]>
<webapp>
&servlets;
</webapp>

where servlets.xml has

<servlet>
<servlet-name>blah</servlet-name>
<display-name>blah</display-name>
<servlet-class>blah.blahclass/servlet-class>
</servlet>
.....
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what version of tomcat are you using? the latest version 5.5.17 should support it.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic