taconite

Setting the content-type of a response in Struts2

痞子三分冷 提交于 2019-11-27 06:24:25
问题 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 content type of "text/xml". I can't seem to find a way to use freemarker directives to set the content type, and I am not well versed enough in struts to know if there is a way to do it through that. So, how should I go about this? 回答1: Or you can set it in the struts.xml <action name="..." class="..."> <result name="SUCCESS">