0

I have tried this but somehow it's not taking/reflecting the changes in the browser

MediaType mediaType = new MediaType("applicaiton", "msword");
        List<MediaType> acceptableMediaTypes = new ArrayList<MediaType>();
        acceptableMediaTypes.add(mediaType);
        
        HttpHeaders headers = new HttpHeaders();
        headers.setAccept(acceptableMediaTypes);
Anjon Roy
  • 7
  • 3
  • Possible duplicate https://stackoverflow.com/questions/14291027/what-is-the-use-of-response-setcontenttypetext-html-in-servlet – Scary Wombat May 06 '22 at 08:30
  • Here they're not returning anything. Return type of the method is void there. But in my case i have to return a template. An html template basically. My function need to be able to do below actions 1. set content-type of response header 2.return a template – Anjon Roy May 06 '22 at 08:35

0 Answers0