Grails 3.1.8 controller

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Grails 3.1.8 controller

This post has NOT been accepted by the mailing list yet.

I'm converting a grails 2.4.4 app to 3.1.8.
In some of my controller methods sometimes (based on what happened in the service call) I'll just set a message in the flash and nothing else, this was fine in 2.4.4, the screen would be re-rendered with the flash message but in 3.1.8 nothing is rendered at all, the screen in totally blank.
Seemingly if I add a statement after setting the message in the flash the screen is rendered, the statement can be anything e.g. println 'hello' or return or new ModelAndView().
Example below:

def index() {
 def res = myService.whatever()
 if (res) {
 [res: res]
else {
 flash.message = message( code: 'no.res' )  // if we get here nothing is rendered

Is this a change to grails 3 or am I missing something somewhere?