Accessing in grails services

To read messages from messages.proprties you need locale. You can get locale like Locale.ITALY or you can get it from request object request.getLocale().

Suppose following is entry in

to get this message in service first inject the MessageSource bean in your service

and use following code

you can give default message as well like

If following is the entry in

then you can pass arguments like

Note:- grails treat [“testString”] as an ArrayList by default and hence we can not use it directly in getMessage like