I found this in the Programming GAE book by Dan Sanderson, O'Reilly,
2010:
An app can determine whether it is running on AppEngine or in the
development server from the servlet info string in the srvlet context,
returned by this.getServletContext()getServletInfo(). This string
starts with Google
Hi all,
App Engine officially supports a way to differentiate
between production and development as follows:
String env = System.getProperty(com.google.appengine.runtime.environment);
if (Development.equals(env)) {
...
} else if (Production.equals(env)) {
...
}
See
Another approach I've just found is doing something like:
ApiProxy.getCurrentEnvironment().getClass().getName().contains
(LocalHttpRequestEnvironment)
Not sure in the end what's the best approach of them all.
On 24 nov, 16:29, Marcel Overdijk marceloverd...@gmail.com wrote:
Or use a Listener
My approach is quite simpler. I keep a configuration file where I
setup a different webBaseURL depending on the environment, development
VS production. One could a a boolean isProduction and make webBaseURL
a function of that. The thing to remember is to setup the config file
before uploading to
Or use a Listener as described here
http://marceloverdijk.blogspot.com/2009/10/determining-runtime-environment-on.html
On 23 nov, 15:58, Nacho Coloma icol...@gmail.com wrote:
To answer my own question, this has been my best shot this far:
SecurityManager sm = System.getSecurityManager();
The filesystem is read only on app engine; would trying to create a file, in
WEB-INF for example, work? I'm wondering if there are corner cases I'm not
thinking of where that might fail and falsely report that you're on app engine;
for example, if you were doing integration tests under Hudson.
Follow that thread:
http://groups.google.co.uk/group/google-appengine-java/browse_frm/thread/8145f547cbaff99e/453847dda0217e71?q=#453847dda0217e71
--
You received this message because you are subscribed to the Google Groups
Google App Engine for Java group.
To post to this group, send email to