【发布时间】:2015-04-24 10:51:56
【问题描述】:
我需要开发一个点击按钮的导出功能,以便我可以将查看的 HTML 页面导出到 word 文档中。
我已经在 JSP/Java 中实现了相同的功能(下面是代码),但是 无法在 Tapestry 中开发相同的功能。
能否请您帮助我,以便我可以开发相同的功能 挂毯 4.
<body>
<%
String exportToWord;
exportToWord = request.getParameter("exportToWord");
if (exportToWord != null && exportToWord.toString().equalsIgnoreCase("YES")){
response.setContentType("application/vnd.ms-word");
response.setHeader("Content-Disposition", "inline;
filename="+"word.doc");}
%>
This is the plain text.<p><i>This is the italic text. </i>
<p><b>This is the old text. </b>
<p><s>This is the strike text.</s>
<p><font color="green">This is he color text. </font>
<p><a href="#">This is hyperlink. </a>
<p><%if exportToWord == null) {%><a href="word.jsp?exportToWord=YES">Export to word</a>
<%}%>
</body>
</html>
【问题讨论】:
-
如果您使用的是 Tapestry 5,那么您可以点击以下链接,因为在我们的项目中我们使用的是旧版本。 stackoverflow.com/questions/29520097/…
-
yeehaaah 牛仔!!!那是你那里的一些非常 hacky JSP!!!
标签: tapestry