<tfoot id='U2ai2'></tfoot>
    1. <i id='U2ai2'><tr id='U2ai2'><dt id='U2ai2'><q id='U2ai2'><span id='U2ai2'><b id='U2ai2'><form id='U2ai2'><ins id='U2ai2'></ins><ul id='U2ai2'></ul><sub id='U2ai2'></sub></form><legend id='U2ai2'></legend><bdo id='U2ai2'><pre id='U2ai2'><center id='U2ai2'></center></pre></bdo></b><th id='U2ai2'></th></span></q></dt></tr></i><div id='U2ai2'><tfoot id='U2ai2'></tfoot><dl id='U2ai2'><fieldset id='U2ai2'></fieldset></dl></div>

      <small id='U2ai2'></small><noframes id='U2ai2'>

      <legend id='U2ai2'><style id='U2ai2'><dir id='U2ai2'><q id='U2ai2'></q></dir></style></legend>

      • <bdo id='U2ai2'></bdo><ul id='U2ai2'></ul>

      在 Struts2 中设置响应的内容类型

      Setting the content-type of a response in Struts2(在 Struts2 中设置响应的内容类型)

              <bdo id='f3szW'></bdo><ul id='f3szW'></ul>

            • <legend id='f3szW'><style id='f3szW'><dir id='f3szW'><q id='f3szW'></q></dir></style></legend>

            • <i id='f3szW'><tr id='f3szW'><dt id='f3szW'><q id='f3szW'><span id='f3szW'><b id='f3szW'><form id='f3szW'><ins id='f3szW'></ins><ul id='f3szW'></ul><sub id='f3szW'></sub></form><legend id='f3szW'></legend><bdo id='f3szW'><pre id='f3szW'><center id='f3szW'></center></pre></bdo></b><th id='f3szW'></th></span></q></dt></tr></i><div id='f3szW'><tfoot id='f3szW'></tfoot><dl id='f3szW'><fieldset id='f3szW'></fieldset></dl></div>
                  <tbody id='f3szW'></tbody>

                <small id='f3szW'></small><noframes id='f3szW'>

                <tfoot id='f3szW'></tfoot>
              1. 本文介绍了在 Struts2 中设置响应的内容类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                所以,我使用带有 Struts2 的 freemarker 模板来制定我的回复.但是,由于我也在尝试使用 taconite,因此我需要使用text/xml"的内容类型发送响应.我似乎找不到使用 freemarker 指令设置内容类型的方法,而且我对 struts 的了解还不够,不知道是否有办法通过它来做到这一点.

                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.

                那么,我该怎么办呢?

                推荐答案

                也可以在struts.xml中设置

                Or you can set it in the struts.xml

                <action name="..." class="...">
                  <result name="SUCCESS">
                    <param name="contentType">text/html</param>
                

                这篇关于在 Struts2 中设置响应的内容类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)

              2. <tfoot id='AYpI1'></tfoot>

                    <tbody id='AYpI1'></tbody>

                    <i id='AYpI1'><tr id='AYpI1'><dt id='AYpI1'><q id='AYpI1'><span id='AYpI1'><b id='AYpI1'><form id='AYpI1'><ins id='AYpI1'></ins><ul id='AYpI1'></ul><sub id='AYpI1'></sub></form><legend id='AYpI1'></legend><bdo id='AYpI1'><pre id='AYpI1'><center id='AYpI1'></center></pre></bdo></b><th id='AYpI1'></th></span></q></dt></tr></i><div id='AYpI1'><tfoot id='AYpI1'></tfoot><dl id='AYpI1'><fieldset id='AYpI1'></fieldset></dl></div>

                    <small id='AYpI1'></small><noframes id='AYpI1'>

                    • <bdo id='AYpI1'></bdo><ul id='AYpI1'></ul>
                      <legend id='AYpI1'><style id='AYpI1'><dir id='AYpI1'><q id='AYpI1'></q></dir></style></legend>