点击链接,调用action,export.gsp接收数据显示
export.gsp:
<%response.setContentType("application/csv");
String fileName ="export.csv"
fileName = response.encodeURL(fileName);
response.setHeader("Content-Disposition", "attachment;fileName=" + fileName);
%>
Promotion ID:,${promotionInstance.id}
FirstName,LastName,CompanyName,Street,CityStateZip,Country,MobilePhone,BusinessPhone,Email,Comment,DateOfBirth
<g:each in="${entryList}" status="i" var="row">
${row.firstName},${row.lastName},${row.companyName},${row.street},${row.cityStateZip},${row.country},${row.mobilePhone},${row.businessPhone},${row.email},${row.comment},<g:formatDate date="${row.dateOfBirth}" format="yyyy-MM-dd" /></g:each>