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 ?
A:
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.
Drackir
2010-10-20 16:02:10
A:
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)
Kendrick
2010-10-20 16:04:54