jsp:
<span><a href="#" οnclick="export_data()">导出数据</a></span>
js:
<script type="text/javascript">
function export_data(){
window.location.href="${ctx}/swipeRecord/reprotRecord";
}
</script>
controller:
/**
* 导出数据
*
* @param response
* @return
* @throws IOException
*/
@RequestMapping("/reprotRecord")
public String reprotRecord(HttpServletResponse response) throws IOException {
// 文件名称
String fileName = URLEncoder.encode("刷卡记录.x