You can run a Java EE application in a test environment, a development environment or a production one.
How can I use Java code or XML to get hold of that information?
if ( ApplicationContext.inDevelopment() { // do this }
Obviously the above is not correct. But you get the point. How can I do this?
there are many ways to achieve it.
check ip address of the sever to decide which platform it is running
on.
add -D property into your server start script, in your program get
the system property.
for different platforms using different properties files. each
properties file contains a “platform” property
or if you are using maven to build your application, you can create
profiles, to set property/attribute at building time.
…