سؤال

I'm using Grails 2.3.6.

I have generated my controllers and views using:

grails generate-all com.mypackage.mydomainclass

I would like to disable automatic JSON/XML marshalling for domain objects and implement only my own services.

I have tried adding the following to my controller:

static responseFormats = ['html']

And it seems to work, is it the proper way?

Thanks.

لا يوجد حل صحيح

نصائح أخرى

Based on the documentation, it looks like you are correct. Athough, it looks like they generally use it to extend support for other types by adding more types, whereas you are using it to limit.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top