ITeye博客

没有风碰着云 谁又知风声近

kong6001 · 共 56 篇文章

Mac OS/Linux命令集合

ps 进程查看 ps -ef|grep java netstat命令 netstat -an | grep 3306 lsof命令 通过list open file命令可以查看到当前打开文件,在linux中所有事物都是以文件形式存在,包括网络连接及硬件设备。 lsof -i:80 -i参数表示网络链接,:80指明端口号,该命令会同时列出PID,方便kill

2015-02-11 10:32 · Linux · 评论(0)

HttpClient 4 必须设超时时间,否则线程一直等在那.

// Note: must set timeout,otherwise alway wait here. // set time out // conntction timeout 20s httpclient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 20000); // transfer time 60s httpclient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 60000);

2014-06-08 11:20 · HttpClient · 评论(0)

Maven-Maven 常用命令

下载依赖包源码 mvn dependency:sources 使用参数: -DdownloadSources=true 下载源代码jar。 -DdownloadJavadocs=true 下载javadoc包。

2012-06-04 11:28 · Maven · 评论(0)

GWT-解决ui.xml代码提示假死

1、在gwt-user-xxx.jar 找到com.google.gwt.uibinder.resources. 解压这三个文件: com.google.gwt.user.client.ui.xsd uibinder.xsd xhtml.ent 2、配置eclipse Window -> Preferences -> Xml -> XmlCatalog -> User Specified Entries -> Add.. -> FileSystem 分别添加刚才的三个文件: 配置如下: key: urn:import:com.google.gwt.user.client.ui file: c…

2012-04-09 11:33 · GWT · 评论(1)

Maven-Maven Dependency Scope

compile 默认的scope,表示 dependency 都可以在生命周期中使用。而且,这些dependencies 会传递到依赖的项目中。 provided 跟compile相似,但是表明了dependency 由JDK或者容器提供,例如Servlet AP和一些Java EE APIs。这个scope 只能作用在编译和测试时,同时没有传递性。 runtime 表示dependency不作用在编译时,但会作用在运行和测试时 test 表示dependency作用在测试时,不作用在运行时。 system 跟provided 相似,但是在系统中要以外部JAR包的形式提供,maven不会在r…

2012-04-05 14:34 · Maven · 评论(0)

iText-带formPDF复制,乱码解决方式

方法1:使用iText中文支持包(见附件iTextAsian-for-5.x-1.0)然后重新设置表单字体即可 if (fields.getFields() != null || !fields.getFields().isEmpty()) {// change field ByteArrayOutputStream exchangeByteOut = new ByteArrayOutputStream(); PdfStamper stamper = new PdfStamper(originReader, exchangeByteOut); fields = stamper.getAcro…

2011-12-30 21:38 · PDF · 评论(0)

Maven-maven项目 could not find the main class

非标准Maven项目运行java类时会报 could not find the main class,由于Maven的输出路径和Eclipse的不一样,所以导致该问题,设置一下Maven的输出路径即可 <build> <sourceDirectory>src</sourceDirectory> <outputDirectory>WebContent/WEB-INF/classes</outputDirectory> <testSourceDirectory>test</testSourceDirectory> <testOutputDirectory>classes</testOutputD…

2011-08-31 20:16 · Maven · 评论(0)

iText-为PDF添加水印

private static void addWatermark(PdfStamper stamper, Rectangle pageRectangle, int waterMarkCount, String waterMarkName) { PdfContentByte content; BaseFont base = null; try { //设置字体 base = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED); } catch (DocumentException e)…

2011-08-17 09:36 · PDF · 评论(2)

iText-对PDF进行数字签名和文档加密

try { PdfReader reader = null; reader = new PdfReader(domainDoc.getDoc()); ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); com.itextpdf.text.Document document = new com.itextpdf.text.Document(); PdfCopy copy = new PdfCopy(document, byteOut); document.open(); int pageNum = reader.getNum…

2011-08-17 09:32 · PDF · 评论(4)

jQuery-提示插件

Poshy Tip - jQuery Plugin for Stylish Tooltips http://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/

2011-08-17 09:24 · jQuery · 评论(0)

Maven-批量上传Jar 到私服 Bat

利用Bat脚本,批量上传当前目录的jar 到私服 @echo off :: init params set version=1.0.0 set groupId=XX set artifactIdPrefix=portal set url=http://XX:8082/content/repositories/portal/ set repositoryId=bglserver set deployFile=*.jar echo Searching jar file... rem 启用"延缓环境变量扩充" SETLOCAL ENABLEDELAYEDEXPANSION for %%f in (…

2011-08-05 17:15 · Maven · 评论(0)

Manve-把包安装到本地库和私服

安装到本地库 mvn install:install-file -DgroupId=au.com.bglcorp -DartifactId=portal-xmlschemas -Dversion=1.0 -Dfile=xmlschemas.jar -Dpackaging=jar -DgeneratePom=true 安装到私服(Nexue) jar包: mvn deploy:deploy-file -DgroupId=au.com.bglcorp -DartifactId=portal-jar -Dversion=1.0.0 -Dpackaging=jar -Dfile=bglportal.…

2011-08-04 21:41 · Maven · 评论(0)

Java 使用keeytool生成密钥库和数字证书

详细说明 http://download.oracle.com/javase/1.4.2/docs/tooldocs/windows/keytool.html 常用操作: 1、Create a keystore keytool.exe -genkey -alias dennyStcert -keystore denny.keystore -storepass "store_password" -keypass "key_passwrod" -keyalg "RSA" keytool.exe -genkey -alias jamesStcert -keystore james.keystore…

2011-06-07 11:19 · JAVA · 评论(0)

Spring 中注入HttpServletRequest

@Autowired(required=true) private HttpServletRequest request;

2011-05-31 09:48 · Spring · 评论(0)

Maven 3的10大新特性详解

参考 http://tech.it168.com/a2010/1108/1123/000001123274_all.shtml http://www.developer.com/java/article.php/3908561/article.htm 6年了,我们终于等来了Maven 3,Maven 2虽然达到了一定的高度达,但它有两个死穴,一是难以扩展,二是它的代码难以理解,在Maven 3中,许多功能都进行了改造,消灭了Maven 2一直被人诟病的许多问题,在这篇文章中,我将介绍Maven 3的10大新特性。 1、向后兼容 Maven创始人,Sonatype公司的CTO Jason va…

2011-05-11 17:01 · Maven · 评论(0)