Exporting as pdf,csv & xml is from struts-displaytag
properties. You have to use displaytag in your JSP page and then use the list actorList
.
It doesn't depend on Database. Once the list gets the values (either from DB or other ways-hard coded too), you can display it in your JSP using displaytag
property. And it will show the option of exporting, provided you set it to true.
This would looks like the same as in your question.
<display:table id="data" name="sessionScope.UserForm.actorList" requestURI="/userAction.do" pagesize="10" export="true">
<display:column property="tvShow" title="TV Show" sortable="true" media="html" group="1" />
<display:column property="userName" title="User Name" sortable="true" />
<display:column property="emailId" title="Email Id" sortable="true" />
<display:setProperty name="export.excel.filename" value="ActorDetails.xls"/>
<display:setProperty name="export.pdf.filename" value="ActorDetails.pdf"/>
<display:setProperty name="export.pdf" value="true" />
</display:table>