DisplayTag Export and Links

2019-07-10 14:49发布

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.

1条回答
Bombasti
2楼-- · 2019-07-10 15:36

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" />
查看更多
登录 后发表回答