Grails “render” renders the template

后端 未结 4 2054
無奈伤痛
無奈伤痛 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:58

    Resolved: Adding contentType results in the template not being rendered:

    render text: "Name: ${person.name}", contentType: "text/plain"
    

提交回复
热议问题