DisplayTag 导出和链接

发布于 2024-11-01 19:43:32 字数 110 浏览 6 评论 0原文

我正在使用 DisplayTag 库 1.2,导出时所有链接都导出为文本。如何从导出中删除链接。

I'm using the DisplayTag library 1.2 and on the export all links are exported as text. How to remove the links from export.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

好多鱼好多余 2024-11-08 19:43:32

您可以将 display:column 标记上的媒体属性设置为“html”,以便仅在 JSP 上显示该列,而不在导出中显示该列。然后,您将再次获得相同的列,但将媒体属性设置为您的导出类型,例如“excel”,以便它仅显示在导出中,而不显示在 JSP 上。

例如,我有一个“标题”列,其中有一个链接,但我不希望导出该链接。不过,我确实希望导出纯标题。我通过使用两个 display:column 条目来实现这一点:一个用于在 JSP 中查看,另一个用于导出到 Excel:

<display:column title="Title" sortable="true" property="title" 
    href="editAlert.do" paramId="id" paramProperty="id" media="html"/>
<display:column title="Title" property="title" media="excel" />

You can set the media attribute to 'html' on the display:column tag to only show that column on the JSP and not in the export. You then have the same column again, but with the media attribute set to your export type, say 'excel' so that it only shows in the export and not on the JSP.

For instance I have a 'title' column that has a link in it, but I don't want the link exported. I do however want the pure title exported. I do this by having two display:column entries: one for viewing in the JSP and one for exporting to excel:

<display:column title="Title" sortable="true" property="title" 
    href="editAlert.do" paramId="id" paramProperty="id" media="html"/>
<display:column title="Title" property="title" media="excel" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文