String fname = MessageFormat.format( "test-{0,date,yyyyMMdd}.xsl", new Object [] { new Date() } );response.setHeader("Content-Disposition","attachment; filename=" + fname );我认为这应该为您工作。
花括号中的文本告诉
MessageFormat类
0从给定数组中插入值,并
date使用格式将其格式化
yyyyMMdd(例如,
20161231对于2016年12月31日而言)。



