I am developing a GWT application.
And I would like to know if I am running over a Jboss instance or over a Jetty instance.
This is because if I am running over Jetty it means that I am running the dev mode and I need to redirect to MyModule.html?codeserver… but if I am running over Jboss I need to redirect to MyModule.html
But I can’t figure how can I know if I am running over Jetty or over Jboss.
You should not try to find out the webserver on which your application is running, in your application code. Instead you can have a discriminating parameter set in the context of your application with different values for different servers.
E.g.
For JBoss, the server.xml can contain a parameter in the context definition as follows:
and for Jetty, the same context parameter would go into its jetty.xml but the value as “devo”.