views:

103

answers:

2

My goal is to install only one WAR file but to use test or production settings (for example to point to different databases) depending on the context root.

  • mydomain.com/MyWebApp will use production settings
  • mydomain.com/MyWebAppTEST will use test settings

Internally the application then should check if the context name ends with TEST to control the configuration.

Is this possible with JBoss 4?

Edit: after rethinking the problem it looks like using a dedicated test / staging server installation of JBoss is much safer. Installing two copies of the same web application on one server would require a lot of additional logic. For example, if the web application needs to use a different database, it has to pass a test/production mode flag to the server at the start of a session. The server must not load the database data in advance but has to wait until the client tells him which database to use.

A: 

Deploy two identical copies of the same WAR file, one called MyWebApp.war, the other called MyWebAppTEST.war?

skaffman
A: 

Why would you do that instead of building and deploying two WARs from the same code base but with different settings?

Pascal Thivent