开发者

How to detect dynamically if the app is under local/online environment

greetings开发者_开发问答 all i want to detect dynamically if the application is under local environment (development) or online server environment, through the httpservletRequest maybe , i don't know, any ideas ?


I always do it in the configuration file, and manage the development and production configuration files as two separate entities (i.e. in separate places within version control)


You could try using getRequestURL() on your HttpServletRequest object to retrieve the URL that is being requested. Then search that string for "localhost" or your development IP address.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜