|
@@ -17,6 +17,8 @@ public class ExportUtils {
|
|
|
|
|
|
private static final String DEFALUT_EXT = ".xlsx";
|
|
private static final String DEFALUT_EXT = ".xlsx";
|
|
|
|
|
|
|
|
+ private static final String DYNAMIC_DEFALUT_EXT = ".xls";
|
|
|
|
+
|
|
public static void exportEXCEL(String fileName, Class<?> dataClass,
|
|
public static void exportEXCEL(String fileName, Class<?> dataClass,
|
|
Collection<?> dataset, HttpServletResponse response) {
|
|
Collection<?> dataset, HttpServletResponse response) {
|
|
try {
|
|
try {
|
|
@@ -45,7 +47,7 @@ public class ExportUtils {
|
|
try {
|
|
try {
|
|
try {
|
|
try {
|
|
response.setHeader("Content-Disposition", "inline; filename="
|
|
response.setHeader("Content-Disposition", "inline; filename="
|
|
- + URLEncoder.encode(fileName, "UTF-8") + DEFALUT_EXT);
|
|
|
|
|
|
+ + URLEncoder.encode(fileName, "UTF-8") + DYNAMIC_DEFALUT_EXT);
|
|
response.setContentType(DEFALUT_CONTENT_TYPE);
|
|
response.setContentType(DEFALUT_CONTENT_TYPE);
|
|
ServletOutputStream outputStream = response.getOutputStream();
|
|
ServletOutputStream outputStream = response.getOutputStream();
|
|
wb.write(outputStream);
|
|
wb.write(outputStream);
|