setting play id at runtime

64 views
Skip to first unread message

Mark Ng

unread,
Jul 5, 2011, 6:45:34 AM7/5/11
to play-framework
Hi,

I would like to set the play id at runtime instead of the
webapplication reading the play id as a context-param in the web.xml.
The reason being is that we currently build a single war file and
deploy it to mutiple environments, where a system property set in each
environment is used accordingly. However in play i would need to build
a war file for each environment test,qa,staging etc however as we have
in the order of 10+ environments that would mean i would have to have
a war for each environment.

Looking at your code are you able to do modify the Servlet Wrapper to
something like

String playId= System.getProperty("play.id");
if(playId == null) {
playId = e.getServletContext().getInitParameter("play.id");
}

Neoh59

unread,
Feb 8, 2012, 11:48:15 AM2/8/12
to play-fr...@googlegroups.com
Hi all !

I up this message. I have the same problem.
Need to run my apps in an application server (JBoss in my case), so I use the war packaging.
But it's a pain to generate a different war for each environment. (and not a best practice IMHO)

Setting the play.id as a JVM parameter could be a nice solution.
The other solution is to extract the application file from the war, in this case I have a different conf file per each environment (not so good because I can change a parameter, for example change SMTP host, without to deploy a new war).

Thanks for your help.


Neoh59

unread,
Feb 8, 2012, 11:50:45 AM2/8/12
to play-fr...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages