0

We have a GWT Application that has to link another Application.

This link is different in all stages of my application (local, test, staging, prod). What options are there to configure a GWT app?

Currently we're using properties files for every environment. The problem with this solution is, that we have to create different packages for all the environments. That's bad and we want to build one single package that is deployable to all environments.

But how can we tell the application which configuration to use?

marco
  • 195
  • 2
  • 8

2 Answers2

-1

If you want to know weather the application is running in which mode , there are some static methods in GWT class .

isClient()

Returns true when running inside the normal GWT environment, either in Development Mode or Production Mode. Returns false if this code is running in a plain JVM. This might happen when running shared code on the server, or during the bootstrap sequence of a GWTTestCase test.

isProdMode()

Returns true when running in production mode. Returns false when running either in development mode, or when running in a plain JVM.

isScript()

Determines whether or not the running program is script or bytecode.

etc....

Based upon tha flags you can configure the folder name of the properties

Suresh Atta
  • 120,458
  • 37
  • 198
  • 307
  • I know these functions. But in my eyes it's only possible to know if the app runs in development mode or not (or in other words local vs. test, staging, production). But also I want to configure the app differently in test vs staging vs production. – marco Apr 17 '13 at 08:32
-1

If you are lord of the rings fan -

One Build to rule them all, One Build to find then,
One Build to work on all and in the environment bind them
In the Land of Testing where the Shadows lie.

Solution at our workspace

  1. All the environment specific properties file are pushed into template folder ( log4j_prod.properties,log4j_stage.properties, hibernate.properties etc )
  2. Prod properties file are default and pushed to WEB-INF/classes
  3. QA team modifies the property files using the template files for any other environment.

I too would be curious if it is done any other way :)

appbootup
  • 9,537
  • 3
  • 33
  • 65