前段时间应用jxls做了excel导出功能,文件名自命为英文名,后来需求人中要求改为中文,这件事苦恼了我数天,在网上搜也没有找到太好的解决办法,今天终于找到了最简单有效的办法。代码如下:
<%@ page contentType="text/html; charset=GBK" %>
<%@ include file="/common/jsp/include.jsp"%>
<%@ include file="/common/js/utility/String.js"%>
<%@ page import="java.io.*" %>
<%@ page import="java.net.*" %>
<%
String attempStr = (String)com.boco.webmaster.startup.WMClientCfg.getInstance().getSubSystemUrl().get("webattempSysStartUri"); //attempStr是服务地址,如http://10.0.7.111:9900/webmaster
String contextPath = attempStr+"//exportFile";
String fileName = request.getParameter("filename");
String filepath = contextPath+"//"&#