html table导出到Excel中,走后台保存文件,js并调用另保存
tableToExcel工具类,此工具类指定格式的表格进行转Excel
格式:其中不能带有thead,tbody和th标签
<table>
<tr>
<td>表头1</td>
<td>表头2</td>
<td>表头3</td>
<td>表头4</td>
</tr>
<tr>
<td>数据1</td>
<td>数据2</td>
<td>数据3</td>
<td>数据4</td>
</tr>
<tr>
<td>数据1</td>
<td>数据2</td>
<td>数据3</td>
<td>数据4</td>
</tr>
</table>
工具类:
package com.zx.erjiqualitydata; import java.io.ByteArrayInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.CellRangeAddress;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.Workbook;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.springframework.util.ClassUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; public class TableToExcel {
/**
* @author lusong
* @param sheetName
* @param html
* @param headNum表头的行数
* @throws FileNotFoundException
* zyn
* 2012-12-21 下午1:44:02
*/
public static String tableToExcel(String sheetName,String html,int headNum) throws FileNotFoundException{
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet(sheetName);
CellStyle headStyle = createHeadStyle(wb);
CellStyle bodyStyle = createBodyStyle(wb);
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
String filePath = request.getSession().getServletContext().getRealPath("/static/document");
String path = filePath+"\\"+sheetName+".xlsx";
FileOutputStream os = new FileOutputStream(path);
SAXBuilder sb = new SAXBuilder();
try {
ByteArrayInputStream is = new ByteArrayInputStream(html.getBytes("UTF-8"));
Document document = sb.build(is);
//获取table节点
Element root = document.getRootElement();
//获取tr的list
List<Element> trList = root.getChildren("tr");
int[][] area = getCellArea(trList);
//循环创建行
for(int i=0;i<trList.size();i++){
HSSFRow row = sheet.createRow(i);
List<Element> tdList = trList.get(i).getChildren("td");
//该行td的序号
int tdIndex = 0;
for(int ii=0;ii<area[i].length;ii++){
row.createCell(ii);
HSSFCell cell = row.getCell(ii);
//判断是否为表头,使用对应的excel格式
if(i<headNum){
cell.setCellStyle(headStyle);
}else{
cell.setCellStyle(bodyStyle);
}
//如果对应的矩阵数字为1,则和横向前一单元格合并
if(area[i][ii]==1){
sheet.addMergedRegion(new CellRangeAddress(i,i,ii-1,ii));
}else if(area[i][ii]==2){//如果对应的矩阵数字为2,则和纵向的前一单元格合并
sheet.addMergedRegion(new CellRangeAddress(i-1,i,ii,ii));
}else{//如果为0,显示td中对应的文字,td序号加1
cell.setCellValue(getInnerText(tdList.get(tdIndex)));
tdIndex ++;
} } }
wb.write(os); } catch (JDOMException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return "static/document/"+sheetName+".xlsx";
} /**
* 导出excel表格二维数组:0为文字占用格,1为横向被合并格,2为纵向合并格
* @param trList
* @return
* zyn
* 2012-12-21 下午1:35:40
*/
private static int[][] getCellArea(List<Element> trList){
//获取table单元格矩阵
Element headtr = trList.get(0);
List<Element> headTdList = headtr.getChildren("td");
//每行的未经合并的单元格个数
int cols = 0;
for(Element e:headTdList){
int colspan = Integer.valueOf(null==e.getAttributeValue("colspan")?"0":e.getAttributeValue("colspan"));
if(colspan==0){
colspan =1;
}
cols += colspan;
}
//初始化单元格矩阵
int[][] area = new int[trList.size()][cols];
for(int i=0;i<trList.size();i++){
Element tr = trList.get(i);
List<Element> tdList = tr.getChildren("td");
//该行到ii个单元格为止被合并的单元格个数
int rowColspan = 0;
for(int ii=0;ii<tdList.size();ii++){
//本单元格跨度计算前的td数
int oldIndex = ii+rowColspan;
Element td = tdList.get(ii);
int colspan = Integer.valueOf(null==td.getAttributeValue("colspan")?"0":td.getAttributeValue("colspan"));
//colspan为0或者1证明未合并
colspan = colspan>1?colspan:1;
rowColspan += colspan-1;
//单元格需要被横向合并声明为1
for(int m=1;m<colspan;m++){
area[i][oldIndex+m]=1;
}
int rowspan = Integer.valueOf(null==td.getAttributeValue("rowspan")?"0":td.getAttributeValue("rowspan"));
rowspan = rowspan>1?rowspan:1;
//单元格需要被纵向向合并声明为2
for(int m=1;m<rowspan;m++){
area[m+i][oldIndex] = 2;
}
}
}
/*for(int a=0;a<area.length;a++){
for(int b =0;b<area[0].length;b++){
System.out.print(area[a][b]);
}
System.out.println("");
}*/
return area;
} /**-
* 设置表头样式
* @param wb
* @return
*/
private static CellStyle createHeadStyle(Workbook wb){
CellStyle style = wb.createCellStyle();
Font headerFont = wb.createFont();
headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
style.setAlignment(CellStyle.ALIGN_CENTER);
style.setFillForegroundColor(IndexedColors.LIGHT_CORNFLOWER_BLUE.getIndex());
style.setFillPattern(CellStyle.SOLID_FOREGROUND);
style.setFont(headerFont); style.setBorderRight(CellStyle.BORDER_THIN);
style.setRightBorderColor(IndexedColors.BLACK.getIndex());
style.setBorderBottom(CellStyle.BORDER_THIN);
style.setBottomBorderColor(IndexedColors.BLACK.getIndex());
style.setBorderLeft(CellStyle.BORDER_THIN);
style.setLeftBorderColor(IndexedColors.BLACK.getIndex());
style.setBorderTop(CellStyle.BORDER_THIN);
style.setTopBorderColor(IndexedColors.BLACK.getIndex());
return style;
} /**-
* 设置表单记录样式
* @param wb
* @return
*/
private static CellStyle createBodyStyle(Workbook wb){
CellStyle style = wb.createCellStyle();
Font headerFont = wb.createFont();
headerFont.setBoldweight(Font.BOLDWEIGHT_NORMAL);
style.setAlignment(CellStyle.ALIGN_CENTER);
style.setFillForegroundColor(IndexedColors.LIGHT_GREEN.getIndex());
style.setFillPattern(CellStyle.SOLID_FOREGROUND);
style.setFont(headerFont); style.setBorderRight(CellStyle.BORDER_THIN);
style.setRightBorderColor(IndexedColors.BLACK.getIndex());
style.setBorderBottom(CellStyle.BORDER_THIN);
style.setBottomBorderColor(IndexedColors.BLACK.getIndex());
style.setBorderLeft(CellStyle.BORDER_THIN);
style.setLeftBorderColor(IndexedColors.BLACK.getIndex());
style.setBorderTop(CellStyle.BORDER_THIN);
style.setTopBorderColor(IndexedColors.BLACK.getIndex());
return style;
} private static String getInnerText(Element td){
String txt = "";
if(td.getText()==null || td.getText().equals("")){
if(null != td.getChildren()){
for(int i=0;i<td.getChildren().size();i++){
Element e = (Element)td.getChildren().get(i);
txt += getInnerText(e);
}
}
}else{
txt = td.getText();
}
return txt;
} public static void main(String[] args) throws FileNotFoundException {
// // TODO Auto-generated method stub
// TableToExcelUtil tu = new TableToExcelUtil();
// System.out.println(tu.getInnerHtml(\"<td><a>1</a></td>\"));
String tableHtmlString = "<table class=\"zx_total_table dataTable no-footer\" style=\"width: 100%; margin: 0px auto;\" id=\"rf_table\" role=\"grid\"><thead><tr role=\"row\" style=\"height: 0px;\"><th class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 241px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\"><div class=\"dataTables_sizing\" style=\"height:0;overflow:hidden;\">医疗机构名称</div></th><th class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 162px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\"><div class=\"dataTables_sizing\" style=\"height:0;overflow:hidden;\">级别</div></th><th class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 83px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\"><div class=\"dataTables_sizing\" style=\"height:0;overflow:hidden;\">类别</div></th><th class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 83px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\"><div class=\"dataTables_sizing\" style=\"height:0;overflow:hidden;\">属性</div></th><th class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 163px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\"><div class=\"dataTables_sizing\" style=\"height:0;overflow:hidden;\">所有制</div></th><th class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 441px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\"><div class=\"dataTables_sizing\" style=\"height:0;overflow:hidden;\">所在地</div></th></tr></thead><tbody><tr role=\"row\" class=\"odd\"><td class=\"sorting_1\">河北二院</td><td>三级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"even\"><td class=\"sorting_1\">河北二院</td><td>二级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"odd\"><td class=\"sorting_1\">河北二院</td><td>二级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"even\"><td class=\"sorting_1\">河北二院</td><td>三级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"odd\"><td class=\"sorting_1\">河北二院</td><td>二级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"even\"><td class=\"sorting_1\">河北二院</td><td>二级医院</td><td>综合</td><td>公立</td><td>公有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"odd\"><td class=\"sorting_1\">河北二院</td><td>三级医院</td><td>综合</td><td>公立</td><td>公有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"even\"><td class=\"sorting_1\">河北二院</td><td>二级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"odd\"><td class=\"sorting_1\">省三院</td><td>二级医院</td><td>综合</td><td>公立</td><td>公有制</td><td>河北省-石家庄市-长安区</td></tr><tr role=\"row\" class=\"even\"><td class=\"sorting_1\">省三院</td><td>二级医院</td><td>综合</td><td>公立</td><td>阿斯蒂芬</td><td>北京-北京市-东城区</td></tr></tbody>"; //tableToExcel("缴费统计", "<table ><tr role=\"row\" style=\"height: 0px;\"><td class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 174px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\"><div class=\"dataTables_sizing\" style=\"height:0;overflow:hidden;\"></div></td><td class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 174px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\"><div class=\"dataTables_sizing\" style=\"height:0;overflow:hidden;\"></div></td><td class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 89px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\"><div class=\"dataTables_sizing\" style=\"height:0;overflow:hidden;\"></div></td><td class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 90px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\"><div class=\"dataTables_sizing\" style=\"height:0;overflow:hidden;\"></div></td><td class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 174px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\"><div class=\"dataTables_sizing\" style=\"height:0;overflow:hidden;\"></div></td><td class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 472px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\"><div class=\"dataTables_sizing\" style=\"height:0;overflow:hidden;\"></div></td></tr><tr role=\"row\" class=\"odd\"><td class=\"sorting_1\">河北二院</td><td>三级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"even\"><td class=\"sorting_1\">河北二院</td><td>二级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"odd\"><td class=\"sorting_1\">河北二院</td><td>二级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"even\"><td class=\"sorting_1\">河北二院</td><td>三级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"odd\"><td class=\"sorting_1\">河北二院</td><td>二级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"even\"><td class=\"sorting_1\">河北二院</td><td>二级医院</td><td>综合</td><td>公立</td><td>公有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"odd\"><td class=\"sorting_1\">河北二院</td><td>三级医院</td><td>综合</td><td>公立</td><td>公有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"even\"><td class=\"sorting_1\">河北二院</td><td>二级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"odd\"><td class=\"sorting_1\">省三院</td><td>二级医院</td><td>综合</td><td>公立</td><td>公有制</td><td>河北省-石家庄市-长安区</td></tr><tr role=\"row\" class=\"even\"><td class=\"sorting_1\">省三院</td><td>二级医院</td><td>综合</td><td>公立</td><td>阿斯蒂芬</td><td>北京-北京市-东城区</td></tr></table>", 1);
tableToExcel("缴费统计", "<table class=\"zx_total_table dataTable no-footer\" style=\"width: 100%; margin: 0px auto;\" id=\"rf_table\" role=\"grid\"><tr role=\"row\" style=\"height: 0px;\"><td class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 241px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\">医疗机构名称</td><td class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 162px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\">级别</td><td class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 83px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\">类别</td><td class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 83px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\">属性</td><td class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 163px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\">所有制</td><td class=\"sorting\" aria-controls=\"rf_table\" rowspan=\"1\" colspan=\"1\" style=\"width: 441px; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px;\">所在地</td></tr><tr role=\"row\" class=\"odd\"><td class=\"sorting_1\">河北二院</td><td>三级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"even\"><td class=\"sorting_1\">河北二院</td><td>二级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"odd\"><td class=\"sorting_1\">河北二院</td><td>二级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"even\"><td class=\"sorting_1\">河北二院</td><td>三级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"odd\"><td class=\"sorting_1\">河北二院</td><td>二级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"even\"><td class=\"sorting_1\">河北二院</td><td>二级医院</td><td>综合</td><td>公立</td><td>公有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"odd\"><td class=\"sorting_1\">河北二院</td><td>三级医院</td><td>综合</td><td>公立</td><td>公有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"even\"><td class=\"sorting_1\">河北二院</td><td>二级医院</td><td>综合</td><td>公立</td><td>私有制</td><td>河北省-石家庄市-裕华区</td></tr><tr role=\"row\" class=\"odd\"><td class=\"sorting_1\">省三院</td><td>二级医院</td><td>综合</td><td>公立</td><td>公有制</td><td>河北省-石家庄市-长安区</td></tr><tr role=\"row\" class=\"even\"><td class=\"sorting_1\">省三院</td><td>二级医院</td><td>综合</td><td>公立</td><td>阿斯蒂芬</td><td>北京-北京市-东城区</td></tr></table>", 1);
} }
html table导出到Excel中,走后台保存文件,js并调用另保存的更多相关文章
- html table表格导出excel的方法 html5 table导出Excel HTML用JS导出Excel的五种方法 html中table导出Excel 前端开发 将table内容导出到excel HTML table导出到Excel中的解决办法 js实现table导出Excel,保留table样式
先上代码 <script type="text/javascript" language="javascript"> var idTmr; ...
- C# html的Table导出到Excel中
C#中导出Excel分为两大类.一类是Winform的,一类是Web.今天说的这一种是Web中的一种,把页面上的Table部分导出到Excel中. Table导出Excel,简单点说,分为以下几步: ...
- HTML table导出到Excel中的解决办法
第一部分:html+js 1.需要使用的表格数据(先不考虑动态生成的table) <table class="table tableStyles" id="tabl ...
- html table导出到Excel中,不走后台,js完成
静态表格table <table class="table tableStyles" id="tables"> <caption>不正经 ...
- 【ASP.NET】C# 将HTML中Table导出到Excel(TableToExcel)
首先,说下应用场景 就是,把页面呈现的Table 导出到Excel中.其中使用的原理是 前台使用ajax调用aspx后台,传递过去参数值,导出.使用的组件是NPOI. 前台调用: <script ...
- 将datagrid中数据导出到excel中 -------<<工作日志2014-6-6>>
前台datagrid数据绑定 #region 导出到excel中 /// <summary> /// 2014-6-6 /// </summary> / ...
- HTML Table导出为Excel的方法
HTML Table导出为Excel的方法: 直接上源码 <html> <head> <meta http-equiv="Content-Type" ...
- 将Datagridview中的数据导出至Excel中
首先添加一个模块ImportToExcel,并添加引用 然后导入命名空间: Imports Microsoft.Office.Interop Imports System.Da ...
- html table 保存到excel中
引用:HTML中的table导出为Excel文件 <!DOCTYPE html> <html lang="en"> <head> <met ...
随机推荐
- 【NOIP 模拟赛】 道路
题目描述在二维坐标平面里有 N 个整数点,信息班某一巨佬要访问这 N 个点.刚开始巨佬在点(0,0)处. 每一步,巨佬可以走到上.下.左.右四个点.即假设巨佬当前所在点的坐标是(x,y),那么它下一步 ...
- [eMMC]eMMC读写性能测试
读写速率(dd) https://www.shellhacks.com/disk-speed-test-read-write-hdd-ssd-perfomance-linux/ eMMC健康情况(mm ...
- PO 审批及生成xml文件
*********************************************************************** * Report : YTST_RAINY_MM2 * ...
- NSDate的具体使用(转载)
NSDate的具体使用 时间与日期处理 主要有以下类: NSDate -- 表示一个绝对的时间点 NSTimeZone -- 时区信息 NSLocale -- 本地化信息 NSDateComponen ...
- RAC 单节点实例异常关闭,关键报错ORA--29770
监控系统监控到RAC 的一个实例异常关闭 ,时间是凌晨1点多,还好没有影响到业务 之后就是分析原因 这套RAC搭建在虚拟化环境OS SUSE11 查看oracel alert log信息 Mon :: ...
- IOS微信禁用分享跳转页面返回BUG修复
fresh(); function fresh() { let isPageHide = false; window.addEventListener('pageshow', function () ...
- adb pull / push
刚才搞了半天想pull,就是pull不成,如图: 看出哪里有问题了吗? 问题就是我不该在shell里面运行adb pull! 正确的做法: 在任意一处打开命令行比如图中的桌面, adb pull /s ...
- .html 页面修改成 .jsp 后缀后中文乱码解决办法。
.html 后缀的文件,如果直接将 .html后缀改成 .jsp 后缀,则会乱码. 正确方法如下: 将如图的代码中 html 声明去掉,然后加上这段代码:<%@ page language=& ...
- BZOJ_2850_巧克力王国_KDTree
BZOJ_2850_巧克力王国_KDTree Description 巧克力王国里的巧克力都是由牛奶和可可做成的.但是并不是每一块巧克力都受王国人民的欢迎,因为大家都不喜 欢过于甜的巧克力.对于每一块 ...
- java-swingButton
package com.http; import java.awt.*; import java.awt.event.*; import javax.swing.*; import com.http. ...