Grails

Regression: using render with a contentType does not properly set that type if g.render was called before

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.0.1
  • Fix Version/s: 1.0.2
  • Component/s: View technologies
  • Labels:
    None
  • Environment:
    Linux JDK 1.6

Description

The following is a very painful regression (it worked perfect in 1.0 and actually prevents me from upgrading to 1.0.1).

If I have the following code in a controller's action:

String itemEditionTemplateCode = g.render(template: "/shopItem/edit")

String jsonData = ["itemEditionTemplate": itemEditionTemplateCode].encodeAsJSON()

render(contentType: "application/json", text: jsonData)

Unfortunately the contentType of the last render will be ignored. I will get text/html as a content type which won't work for me. It seems to be the previous call to g.render that sets the contentType of the reply incorrectly to text/html. If I remove the g.render tag, the contentType will be fine (eg, application/json).

Please fix it, it broke my whole web-app, and updating to 1.0.1 would be nice as 1.0 has autoreloading issues with the Searchable plugin, which I use...

Activity

Hide
Graeme Rocher added a comment -

1.0.1 has those same auto-reloading issues, so you're better off waiting for 1.0.2

Show
Graeme Rocher added a comment - 1.0.1 has those same auto-reloading issues, so you're better off waiting for 1.0.2
Hide
Graeme Rocher added a comment -

Bulk closing bunch of resolved issues

Show
Graeme Rocher added a comment - Bulk closing bunch of resolved issues

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: