java小技巧
iteye_8494
这个作者很懒,什么都没留下…
展开
-
java 桌面路径
今天在写程序时需要读取桌面的路径,开始时以为需要使用JNI来实现,于是调出Delphi,调用SHGetSpecialFolderLocation方法,处理后返回,编译成DLL,都很顺利。可但是,但可是,我又犯了想当然的错误,这样能不能实现?当然能。只不过还有更好的办法是在之后阅读JDK文档时发现的。其实JDK中已经提供了这个方法,具体方法如下:FileSystemView fsv = FileSy...原创 2015-10-23 09:10:27 · 375 阅读 · 0 评论 -
java a标签乱码
1.tomcat 修改 <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" useBodyEncodingForURI="true" URIEncoding="UTF-8" />原创 2016-01-05 13:11:23 · 294 阅读 · 0 评论 -
java 上的各种路径获取
http://localhost:8080/test//test.jsp?p=fuck basePath:http://localhost:8080/test/ getContextPath:/test getServletPath:/test.jsp getRequestURI:/test/test.jsp getRequestURL:http://localhost:8080/te...原创 2016-04-07 10:31:28 · 96 阅读 · 0 评论 -
spring mvc poi导出excel
@RequestMapping(value = "/importexcel.htm", method = RequestMethod.GET) public ModelAndView _importExcel(HttpServletRequest request, HttpServletResponse response, Integer cId) throws Exception ...原创 2016-04-14 13:41:17 · 74 阅读 · 0 评论 -
jquery 导出excel tableExport
引入 jquery 引入 <script type="text/javascript" src=/tableExport.js"></script> 页面talbe <table id="customers"> .... </table> jquery 方法 $('#customers').ta原创 2016-04-14 14:35:26 · 159 阅读 · 0 评论 -
spring 测试类
package com.bst.test; import javax.annotation.Resource; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org....原创 2016-04-18 09:14:09 · 92 阅读 · 0 评论 -
盘点当下最流行的 Java 工具
盘点当下最流行的 Java 工具 http://www.oschina.net/news/76317/popular-java-tools原创 2016-08-25 09:21:06 · 128 阅读 · 0 评论 -
网络爬虫防止被封的策略
网络爬虫防止被封的策略和反反爬策略简单总结 今天不想工作,比较累,遇到一个网站反爬比较严重,不说具体哪个名字了,简单总结下爬虫防封策略 1,伪装http 头 chrome 开发者模式,firebug等抓包工具,查看http 进行模拟User-Agent,有的需要加上Referer,可以多加入几个http user 2,代理ip,对于限制ip 或者ip被封的采用代理...原创 2017-01-18 17:01:09 · 635 阅读 · 0 评论