1

We are using freemarker for templates in our web application. We are using spring's FreeMarkerViewResolver for this.

Is there a way in freemarker to change the content type on the response to

text/xml

is there a way to do this in the template?

Cœur
  • 37,241
  • 25
  • 195
  • 267
harmanjd
  • 1,874
  • 19
  • 21

1 Answers1

1

You can't do it from the template itself, no, but you can inject FreeMarkerViewResolver with a contentType property, and set that to text/xml (or whatever).

If you need different content types for different views, you'll need to configure multiple view resolvers.

skaffman
  • 398,947
  • 96
  • 818
  • 769