{"id":22,"date":"2008-06-03T15:57:01","date_gmt":"2008-09-12T14:39:18","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=22"},"modified":"2015-07-10T13:17:40","modified_gmt":"2015-07-10T07:47:40","slug":"how-to-make-bootstraping-environment-specific-in-a-grails-app","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/how-to-make-bootstraping-environment-specific-in-a-grails-app\/","title":{"rendered":"How to make Bootstraping environment specific in a Grails app?"},"content":{"rendered":"<p><strong>BootStraping<\/strong> is something which is needed in <a title=\"Grails Development\" href=\"http:\/\/www.tothenew.com\/grails-application-development\">most of the grails application<\/a>. One of the frequently asked questions (and a valid requirement as well) is : How do you make Bootstraping happen only in a particular environment.<\/p>\n<p>This can be done by making use of one of the Grails utility class which allows you to inspect the environment in which the code is executing.<\/p>\n<p>Example:<\/p>\n<p>if (GrailsUtil.environment == GrailsApplication.ENV_DEVELOPMENT) {<\/p>\n<p>\/\/ Your bootstraping code here.<\/p>\n<p>}<\/p>\n<p>Don&#8217;t forget to import the following two classes:<\/p>\n<p>org.codehaus.groovy.grails.commons.GrailsApplication<br \/>\ngrails.util.GrailsUtil<\/p>\n<p>Hope this little tips saves you some time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>BootStraping is something which is needed in most of the grails application. One of the frequently asked questions (and a valid requirement as well) is : How do you make Bootstraping happen only in a particular environment. This can be done by making use of one of the Grails utility class which allows you to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":3},"categories":[7],"tags":[4840,9],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/22"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=22"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/22\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}