Grails “render” renders the template

后端 未结 4 2038
無奈伤痛
無奈伤痛 2021-02-06 01:20

In my Grails controller I\'m responding to an AJAX call and using render to return the text:

def ajaxRandomPersonName = {
    def person = get a ran         


        
4条回答
  •  醉梦人生
    2021-02-06 01:54

    Make your client side javascript code handle a JSON respond and render your response with:

    render [text:"Name: ${person.name}"] as JSON

提交回复
热议问题