I wanted my Grails 3.1.5 application to serve JSON data using the * .gson format. And for some pages / urls, I wanted to keep using GSP.
I created the application using the rest-api profile. Then I copied over the controllers and views from another application that I built using web-api.
At the same time, to be consistent, I also moved index.gson to another location.
Now I get a:
Could not resolve view with name 'index' in servlet with name 'grailsDispatcherServlet'
I started digging into viewResolvers, which are available in the 3.1.5 code base. Perhaps the rest-api profile configures viewResolver to search for * .gson files in a specific location.
Is it possible to configure, perhaps, a CompositeViewResolver that looks for both types, * .gson and * .gsps?
If so, how can I do this?
Thank!