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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.