DisplayTag Export and Links

可紊 提交于 2019-12-24 05:22:25

问题


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:


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


来源:https://stackoverflow.com/questions/5680920/displaytag-export-and-links

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!