Setting the content-type of a response in Struts2

后端 未结 5 1526
忘掉有多难
忘掉有多难 2020-12-10 21:28

So, I\'m using freemarker templates with Struts2 to formulate my responses. However, since I\'m trying to use taconite as well, I need the response to be sent with the cont

5条回答
  •  攒了一身酷
    2020-12-10 21:36

    Answered my own question:

    Use the following code at the type of the template:

    ${response.setContentType("text/xml")}
    

提交回复
热议问题