You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Jesse Alexander (KADA 12)" <al...@csfs.com> on 2002/03/14 08:30:03 UTC

RE: "Best Practice" for parsing an XML file for application confi guration parameters?

dead on correct. 

That's why we decided to write the configuration file in xml,
using include (external entities that get included in the complete
xml-stream) and a DTD (to check the format). Then we read it in 
a framework-component and offer it to our app-programmers as
properties using the dot-notation.

We are very happy with this.

regards
Alexander Jesse

-----Original Message-----
From: Ronald Haring [mailto:Haring@furore.com]
Sent: Mittwoch, 6. März 2002 17:08
To: 'Struts Users Mailing List'
Subject: RE: "Best Practice" for parsing an XML file for application
confi guration parameters?


ever since the hype of xml started, people tend to forget about properties.
what is wrong with a properties file nowadays?
Its fast, its simple, and good enough for most configuration issues I have
encountered so far.

Gr
Ronald 

> -----Original Message-----
> From: Matt Raible [mailto:matt_raible@yahoo.com]
> Sent: Wednesday, March 06, 2002 4:42 PM
> To: Struts Users Mailing List
> Subject: "Best Practice" for parsing an XML file for application
> configuration parameters?
> 
> 
> I am developing an application that will require different 
> application settings
> for different machines/customers.
> 
> Because of this, I want to to externalize certain 
> configuration settings to a
> XML file outside of web.xml - let's call this myApp.xml.
> 
> I have a StartupServlet that I can parse this file with.
> 
> 1.  What should I use to parse this file - SAX, DOM, Digester?
> 
> 2.  Should I have a bean that represents all the 
> configuration settings, and
> put this in the ServletContext as an attirubute, or each 
> individual setting?
> 
> 3.  If I use Digester and a bean (seems good), should I 
> change my XML in the
> following snippet?
> 
> <application>
> 	<respository>
> 		<root>d:/repository</root>
> 		<assets>assets</assets>
> 		<viewPath>file://d:/repository/assets</viewPath>
> 	</respository>
> 	<assessment>
> 		<!-- This value is a percentage -->
> 		<default-passing-score>75</default-passing-score>
> 	</assessment>
> </application>
> 
> Any help (or URLs) are appreciated!
> 
> Matt
> 
> __________________________________________________
> Do You Yahoo!?
> Try FREE Yahoo! Mail - the world's greatest free email!
> http://mail.yahoo.com/
> 
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> 


Furore B.V.
Rijswijkstraat 175-8
Postbus 9204
1006 AE Amsterdam
tel. (020) 346 71 71
fax. (020) 346 71 77

----------------------------------------------------------------------------
---------------
The information transmitted is intended only for the person
or entity to which it is addressed and may contain confidential
and/or privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in
reliance upon, this information by persons or entities other
than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material
from any computer
----------------------------------------------------------------------------
---------------


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>