File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Processing extra config XML in servlet init  relayed on DTD/SXD in app context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Processing extra config XML in servlet init  relayed on DTD/SXD in app context" Watch "Processing extra config XML in servlet init  relayed on DTD/SXD in app context" New topic
Author

Processing extra config XML in servlet init relayed on DTD/SXD in app context

D Rog
Ranch Hand

Joined: Feb 07, 2004
Posts: 472

I have a servlet which reads extra configuration files in init method. It uses getResource or something like that to obtain the files. These files have references to DTD/XSD inside of a context of the web application. If the servlet has delayed availability, then config files get processed fine. However if it has an init at load, then references can't be found and parsing of extra config get failed. This behavior is web container dependent. Can somebody recommend more robust solution to get consistent behavior on any web container regardless of order of servlet initialization.


Retire your iPod and start with HD Android music player Kamerton | Minimal J2EE container is here | Light weight full J2EE stack | and build tool | Co-author of "Windows programming in Turbo Pascal"
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Do you have any configuration property file for you application.If yes then you can set property for resolution.
Now you can use something like DTD entity resolver (EntityResolver interface)to resolve the DTD location , which in turn would read the property to find the exact location.This is way your appplication becomes independent of application startup.


Rahul Bhattacharjee
LinkedIn - Blog
 
GeeCON Prague 2014
 
subject: Processing extra config XML in servlet init relayed on DTD/SXD in app context