Apache – Accessing JBoss conf file from Flex

apache-flexjboss

I've got a Flex application running on a JBoss server, with dev/QA/production environments. The application needs to coordinate with some other services, also with QA/prod instances. Currently I'm sending the current URL in via javascript values, like this:

index.template.html

AC_FL_RunContent(
    "FlashVars", "myhost=" + location.hostname,
    etc

index.mxml:

switch (mx.core.Application.application.parameters.myhost) {
   case "qa.servername.com":
       xmlURL = "http://server.com/qa.xml";
       break; 

and so on. I'd rather not do that though; I'd rather edit a .properties file in JBoss to identify a particular machine as QA or Production and access that value via Flex. Any way to do that?

Best Answer

You could create a small servlet that accesses this properties file and sends the appropriate value to the Flex app.