The approach suggested at blob.stringbuffer.com is the approach that we
recommend. We have committed to leaving the strings "Google App Engine" and
"Development" in ServletContext.getServerInfo() so it's safe to rely on
these.
The class names of our SecurityManager implementations, on the other hand,
could change at any time without warning, so I would discourage use of
Radomir's approach.
I agree with Don. If you have access to servlet context that's
definitely the way to go.
On the other side, I needed to detect environment in a part of library
code that has no access to servlet context so checking SecurityManager
class name worked for me. (At this time I think it's safe to assume
that App Engine will always have "google" in package names ;-)
On Aug 4, 5:45 pm, Don Schwarz <schwa...@google.com> wrote:
> The approach suggested at blob.stringbuffer.com is the approach that we
> recommend. We have committed to leaving the strings "Google App Engine" and
> "Development" in ServletContext.getServerInfo() so it's safe to rely on
> these.
> The class names of our SecurityManager implementations, on the other hand,
> could change at any time without warning, so I would discourage use of
> Radomir's approach.
> On Tue, Aug 4, 2009 at 8:39 AM, Roberto Saccon <rsac...@gmail.com> wrote: