grails - display flash message

后端 未结 4 1288
我寻月下人不归
我寻月下人不归 2021-02-14 05:41

I’m new to Grails, and I have a question that should be easy for most of you.

I have a page displaying an object list. I want to display a message if there’

4条回答
  •  独厮守ぢ
    2021-02-14 06:35

    // backend code example
    
    def save () { 
        if(params.name) { 
              . 
              . 
          object.save(); 
          flash.message =  "Saved successfully" 
        } 
        else { 
            flash.message = "Saved fail"
        }
    
    // HTML example
    
    
       
    ${flash.message}

提交回复
热议问题