6 Replies Latest reply on Jul 26, 2007 5:31 PM by rmemoria

    Application configuration parameters

    rmemoria

      Hi all,

      I'm not sure if it`s the right place to post this message.

      I have a SEAM application and some specific parameters are now in hard code, and I want to take them out of the application to a configuration file, but I have no idea how to do that.

      I'm using JBOSS AS, and I believe there is a cleaver way of doing that using some xml file.

      Does anyone can help me?

      regards,
      Ricardo Memória

        • 1. Re: Application configuration parameters
          wise_guybg

          Hi Ricardo,

          You'll have to be more specific on what you need. Most of the parameters should be outside the code already, so you may have application settings that you want to externalize?

          • 2. Re: Application configuration parameters
            rmemoria

            Yes,

            For example, my app saves files uploaded by the user. This system will be installed in several servers to be used localy, so the folder where files will be saved will vary from server to server.

            I'd like to put this information (where to store files) in an external configuration file, and not inside the EAR file.

            Any idea?

            • 3. Re: Application configuration parameters
              wise_guybg

              You can have this information in the database.

              • 4. Re: Application configuration parameters
                dmitriy.lapko

                May be you should take a look at Chapter 4. Configuring Seam components in jboss-seam-2.0.0.BETA1\doc\reference\en\pdf\seam_reference.pdf

                • 5. Re: Application configuration parameters
                  jcg3

                  Your best choices would be either database or jndi if you don't want it in the ear file / hierarchy.

                  I would use jndi if your sysadmin is configuring the file location as it is easier for them to change the files that store the jndi settings than it would be to update a database.

                  If you go for database, you can get the server's host name and use that as a filter in case all the app servers are going to the same db.

                  • 6. Re: Application configuration parameters
                    rmemoria

                    I think that the DB option is the easiest by now.

                    I think JNDI would be the best of the worlds, but I'm a newbie in JNDI and configuration in JBOSS.

                    Do you recommend any article or a good JNDI tutorial with a JBOSS or JEE enphasis?

                    btw... Thanks you all for the quick answer.
                    Ricardo Memoria