DisplayTag导出和链接 [英] DisplayTag Export and Links

查看:138
本文介绍了DisplayTag导出和链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 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.

推荐答案

您可以在display:column标签中将media属性设置为html只显示JSP上的列,而不是导出。然后,您再次具有相同的列,但将media属性设置为导出类型,则说excel,以便仅在导出中显示,而不显示在JSP上。

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.

例如我有一个标题列,其中有一个链接,但我不想导出链接。不过我想要纯粹的标题导出。我通过两个显示:列条目:一个用于在JSP中查看,另一个用于导出到excel:

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" />

这篇关于DisplayTag导出和链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆