What is the best way for a JavaEE application to determine whether it is running on a development or production Glassfish server?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use JNDI for this. Do the following:
Create an resources file:
Then add it to your domain via asadmin
asadmin add-resources resources-file.xml
See http://docs.oracle.com/cd/E18930_01/html/821-2416/gixps.html for details on this.
To query the actual resource value:
If you need to differentiate between more environments, use a String instead of a Boolean.
HTH