Grails message.properties changes not taking effect in deployed application

瘦欲@ 提交于 2019-12-06 13:13:44

As they say, some big questions have a very simple answer! Depending on a post I found, in my resources editor tool, I added this code in my action with other few changes in the bootstarp (see link at the end of the answer):

def messageSource
def saveMessageResources={
    .
    .
    .
    //my action logic
    .
    .
    .    
    messageSource.clearCache()
}

and it worked :)

References: http://jira.grails.org/browse/GPAPPENGINE-44

Deployed application will not pick up changes until you restart it. Changes are reloaded on-thy-fly only in development mode for your convenience. It is called "hot-deployment" because only parts that are changed (messages.properties in your case) are applied.

If you want to edit messages in deployed application you can apply alternative solution - localisation plugin that keeps your messages in database.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!