As the server has no idea in which mode the client runs, the client has to tell it the server.
The default RpcRequestBuilder adds the header "x-gwt-permutation" to server requests to prevent CSRF attacks. It contains the permutation name in production mode and "HostedMode" when running DevMode. So maybe you can simply evaluate this header in the servlet.
-- J.