请大佬帮忙下载CSDN的文件,感谢大佬6

java读取MDB文件里的表和数据?求大佬帮助一下
[问题点数:20分]
本版专家分:0
结帖率 50%
CSDN今日推荐
本版专家分:0
本版专家分:0
本版专家分:0
本版专家分:0
本版专家分:0
匿名用户不能发表回复!|
其他相关推荐csdn上怎么免积分下载啊 求教大佬【java吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:721,046贴子:
csdn上怎么免积分下载啊 求教大佬收藏
csdn上怎么免积分下载啊 求教大佬
不存在的,不过可以求余淘宝代下,1块钱一个资源
登录百度帐号C# 多线程 请求网站 希望大佬们帮助一下
[问题点数:90分]
本版专家分:0
结帖率 66.67%
CSDN今日推荐
本版专家分:304
本版专家分:0
本版专家分:88614
2017年 总版技术专家分年内排行榜第五
2017年7月 总版技术专家分月排行榜第二
2017年6月 总版技术专家分月排行榜第三
2017年12月 .NET技术大版内专家分月排行榜第一2017年11月 .NET技术大版内专家分月排行榜第一2017年10月 .NET技术大版内专家分月排行榜第一2017年9月 .NET技术大版内专家分月排行榜第一2017年8月 多媒体开发大版内专家分月排行榜第一2017年8月 .NET技术大版内专家分月排行榜第一2017年7月 多媒体开发大版内专家分月排行榜第一2017年7月 .NET技术大版内专家分月排行榜第一2017年6月 .NET技术大版内专家分月排行榜第一2017年5月 多媒体开发大版内专家分月排行榜第一2017年4月 多媒体开发大版内专家分月排行榜第一2016年1月 多媒体/设计/Flash/Silverlight 开发大版内专家分月排行榜第一2015年11月 多媒体/设计/Flash/Silverlight 开发大版内专家分月排行榜第一2015年10月 多媒体/设计/Flash/Silverlight 开发大版内专家分月排行榜第一2015年9月 多媒体/设计/Flash/Silverlight 开发大版内专家分月排行榜第一2015年7月 多媒体/设计/Flash/Silverlight 开发大版内专家分月排行榜第一2015年6月 多媒体/设计/Flash/Silverlight 开发大版内专家分月排行榜第一2015年3月 多媒体/设计/Flash/Silverlight 开发大版内专家分月排行榜第一2015年2月 多媒体/设计/Flash/Silverlight 开发大版内专家分月排行榜第一2015年1月 多媒体/设计/Flash/Silverlight 开发大版内专家分月排行榜第一2014年12月 多媒体/设计/Flash/Silverlight 开发大版内专家分月排行榜第一2014年11月 多媒体/设计/Flash/Silverlight 开发大版内专家分月排行榜第一2014年10月 多媒体/设计/Flash/Silverlight 开发大版内专家分月排行榜第一2014年9月 多媒体/设计/Flash/Silverlight 开发大版内专家分月排行榜第一2014年8月 多媒体/设计/Flash/Silverlight 开发大版内专家分月排行榜第一2014年7月 多媒体/设计/Flash/Silverlight 开发大版内专家分月排行榜第一
本版专家分:0
本版专家分:0
本版专家分:2519
本版专家分:9840
本版专家分:15
本版专家分:0
匿名用户不能发表回复!|
其他相关推荐各位大佬 网站改密码验证码只收到四次后就收不到了 (是发到QQ邮箱里的) 求各位大佬帮忙
各位大佬 网站改密码验证码只收到四次后就收不到了 (是发到QQ邮箱里的)求各位大佬帮忙
没有更多推荐了,java调用浏览器导出csv文件
百度了一圈,csv大都是导出和下载分开的,然后根据别人的博客改了改,在此感谢大佬们的付出
&a href="#" onclick="exportData()" class="easyui-linkbutton"
iconCls="icon-save"&导出&/a&
function exportData(){
location.href=basePath +
"/exportAction.do?action=export";
CSV工具包(自己改成了傻瓜式拿来即用的东西)
* response
对应的列标题
* exportData
需要导出的数据
列标题对应的实体类的属性
* IOException
@SuppressWarnings({ "resource", "rawtypes", "unchecked" })
public static void exportFile(HttpServletResponse response,
HashMap map, List exportData, String fileds[])
throws IOException {
File tempFile = File.createTempFile("vehicle", ".csv");
BufferedWriter csvFileOutputStream = null;
csvFileOutputStream = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile), "GBK"), 1024);
for (Iterator propertyIterator = map.entrySet().iterator(); propertyIterator.hasNext();) {
java.util.Map.Entry propertyEntry = (java.util.Map.Entry) propertyIterator.next();
csvFileOutputStream.write((String) propertyEntry.getValue() != null ? new String(((String) propertyEntry.getValue()).getBytes("GBK"), "GBK") : "");
if (propertyIterator.hasNext()) {
csvFileOutputStream.write(",");
csvFileOutputStream.write("\r\n");
for (int j = 0; exportData != null && !exportData.isEmpty()
&& j & exportData.size(); j++) {
Class clazz = exportData.get(j).getClass();
String[] contents = new String[fileds.length];
for (int i = 0; fileds != null && i & fileds. i++) {
String filedName = toUpperCaseFirstOne(fileds[i]);
Object obj = null;
Method method = clazz.getMethod(filedName);
method.setAccessible(true);
obj = method.invoke(exportData.get(j));
} catch (Exception e) {
String str = String.valueOf(obj);
if (str == null || str.equals("null"))
contents[i] =
for (int n = 0; n & contents. n++) {
csvFileOutputStream.write(contents[n]);
csvFileOutputStream.write(",");
csvFileOutputStream.write("\r\n");
csvFileOutputStream.flush();
* 写入csv结束,写出流
java.io.OutputStream out = response.getOutputStream();
byte[] b = new byte[10240];
java.io.File fileLoad = new java.io.File(tempFile.getCanonicalPath());
response.reset();
response.setContentType("application/csv");
String trueCSVName="导出数据.csv";
response.setHeader("Content-Disposition", "
filename="+ new String(trueCSVName.getBytes("GBK"), "ISO8859-1"));
long fileLength = fileLoad.length();
String length1 = String.valueOf(fileLength);
response.setHeader("Content_Length", length1);
java.io.FileInputStream in = new java.io.FileInputStream(fileLoad);
while ((n = in.read(b)) != -1) {
out.write(b, 0, n);
in.close();
out.close();
} catch (IOException e) {
e.printStackTrace();
* 将第一个字母转换为大写字母并和get拼合成方法
private static String toUpperCaseFirstOne(String origin) {
StringBuffer sb = new StringBuffer(origin);
sb.setCharAt(0, Character.toUpperCase(sb.charAt(0)));
sb.insert(0, "get");
return sb.toString();
参考资料:
然后贴一下servlet调用的方法吧
List&RealTimeSO2& exportData = new ArrayList&RealTimeSO2&();
String xhLxComb="output";
String startTime=" 09:01:44";
String gnId="21";
exportData = new SO2DataSelService().listSO2Data(xhLxComb, gnId, startTime);
HashMap map = new LinkedHashMap();
map.put("1", "第一列");
map.put("2", "第二列");
map.put("3", "第三列");
map.put("4", "第四列");
String fileds[] = new String[] { "facName", "jzName" , "xhLx","recDate","so2" };
CVSUtils.exportFile(response, map, exportData, fileds);
最后来个图
这个真的是最后了
因为要传多个参数到后台,然后ajax捣鼓了下不行,百度了下,貌似这种调用浏览器下载要form表单提交才行。。。。
href="#" onclick="exportData()" class="easyui-linkbutton"
iconCls="icon-save"&导出&
* 导出功能
function exportData() {
var exportURL=basePath + "/sO2DataSelAction.do?action=export";
var temp1=$("#xhLxComb").combobox('getValue');
var temp2=$("#gnCombobox").combobox('getValue');
var temp3=$('#startTime').datetimebox('getValue');
* 使用form表单来发送请求
* 1.method属性用来设置请求的类型——post还是get
*2.action属性用来设置请求路径
*3.后台可以根据request.getParameter(XXX)来获取对应name的值。
var form = $("&form&");
form.attr("style", "display:none");
form.attr("target", "");
form.attr("method", "post");
form.attr("action", exportURL);
var input1 = $("&input&");
input1.attr("type", "hidden");
input1.attr("name", "temp1");
input1.attr("value", temp1);
form.append(input1);
var input2 = $("&input&");
input2.attr("type", "hidden");
input2.attr("name", "temp2");
input2.attr("value", temp2);
form.append(input2);
var input2 = $("&input&");
input2.attr("type", "hidden");
input2.attr("name", "temp3");
input2.attr("value", temp3);
form.append(input2);
$("body").append(form);
form.submit();
form.remove();
Java 导出CSV文件及实现web下载CSV
java 导出csv文件
java导出文件之Excel(CSV)下并以流形式输出
利用Javacsv实现Java读写csv文件
导出(下载)数据库查询的数据生成csv文件
SpringMVC实现查询结果下载为CSV文件
将查询结果导出成csv文件(oracle)
Java导出数据库查询结果为excel和csv的简易实现
java实现把数据库数据导出成word文件实现文件下载功能
Java实现数据库数据导出到Excel中并下载到浏览器本地
没有更多推荐了,

我要回帖

更多关于 感谢大佬的话6 的文章

 

随机推荐