1 Reply Latest reply on Feb 21, 2008 3:05 PM by Peter Johnson

    how to add custom properties to xml?

    Shawn K Newbie

      We're currently using a standard configuration file to allow users to choose their datasource and whatnot when running JBoss 4.0.5. Obviously, the properties in this file get passed into the web application but I cannot find how.

      I'd like to add a custom property to the xml file that will be accessible by the web app at runtime. Can someone please explain what I need to do to add a tag and read it in on the application side?

      Here's our standard config xml:

      <?xml version="1.0" encoding="UTF-8"?>
       <!-- Microsoft SQL Server 2000 Database configuration -->

      I would like to add one property that the web app could read:



        • 1. Re: how to add custom properties to xml?
          Peter Johnson Master

          The *-ds.xml file is used as a template to generate several (3-6, if I recall correctly) MBeans. Once the MBeans are generated, the *-ds.xml file is ignored. Apps get at the data source by looking up the name (jdbc/LEDataSource in your example) in JNDI which yields one of the MBeans.

          For web app properties, those are usually best placed into a properties file accessible by the web app (for example, located in WEB-INF/classes), or you could use the properties service - see the properties-service.xml file.