J2EE/Core Java
dfaldflafladl
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Checked and Unchecked Exception
首先是一个要不要用checked Exeption的一个讨论[url]http://www.iteye.com/topic/2038[/url]总结得出的基本原则:[quote]使用Checked Exception还是UnChecked Exception的原则,我的看法是根据需求而定。 如果你希望强制你的类调用者来处理异常,那么就用Checked Exception; ...原创 2010-08-02 10:52:04 · 106 阅读 · 0 评论 -
JAXB入门
[quote]jaxb是一个读写xml的工具,还可以提供验证,不需要额外的jar[/quote]1. XSD sample[code="java"] ...原创 2012-10-16 11:59:08 · 128 阅读 · 0 评论 -
Java 访问sharepoint webservice(NTLM & SSL)
[quote]遇到需要使用java访问微软的sharepoint的webservice, 公司服务器配置的是NTLM+SSL验证解决办法: [b]jdk6支持ntlm和SSL, 同时使用jdk6 webservice做客户端[/b][/quote][b]1 sharepoint wsdl[/b][code="java"]https://server/_vti_bin/lis...原创 2012-06-12 09:47:52 · 421 阅读 · 0 评论 -
File Demo
[code="java"]package org.springside.examples.showcase.utilities.io;import java.io.File;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io...原创 2012-06-25 22:55:08 · 132 阅读 · 0 评论 -
Ehcache RMI Replicated Cluster(RMI集群)
[quote]本文是ehcache RMI集群的例子,导入附件中的java 项目到eclipse中,依次启动附件中的A.java,B.java,C.java, 就可以在eclipse的console中就可以看到3个cache的内容同步啦[/quote]1. ehcache 配置文件[code="java"] [/code]2...原创 2013-04-25 23:39:58 · 151 阅读 · 0 评论 -
nexus-2.1.1安装及使用入门
1. 安装地址[url]http://www.sonatype.org/nexus/[/url]解压之后先安装服务,每次开机自动启动[quote]nexus-2.1.1\bin\jsw\windows-x86-32\install-nexus.bat[/quote]然后查看日志,应该自动启动[code="java"]console-nexus.bat[/code]...原创 2012-08-13 22:52:58 · 329 阅读 · 0 评论 -
XSD 入门使用
[code="java"] ...原创 2012-09-18 23:20:47 · 224 阅读 · 0 评论 -
Java File Diff-diffutils
1. Maven Dependency[code="java"] com.googlecode.java-diff-utils diffutils 1.2.1 [/code]2. Test Class[code="java"]package com.citi.ocean.metadata.util;import java.io.File;i...原创 2012-09-27 17:35:18 · 1727 阅读 · 0 评论 -
Integrete unitils for database(dao) testing
[/code][quote]Database testingUnit tests for the database layer can be extremely valuable when building enterprise applications, but are often abandoned because of their complexity. Unitils greatly ...原创 2013-02-01 18:39:07 · 196 阅读 · 0 评论 -
Start tomcat with port 80 without Linux root user-Use iptables mapping
[quote]In linux system. only root user can use the port small than 1024, so if you change tomcat port to 80 and start without root account, then you will see the following error: [/quote][code="java...原创 2016-05-25 17:39:52 · 136 阅读 · 0 评论 -
HttpURLConnection下载文件
[code="java"]public class HttpDownloadUtility{ private static final Logger logger = LoggerFactory.getLogger(HttpDownloadUtility.class); private static final int BUFFER_SIZE = 4096; ...原创 2015-08-07 11:25:32 · 381 阅读 · 0 评论 -
Freemarker使用入门
[quote]freemarker是一种模板标记工具,可以做页面静态化,代码生成 http://freemarker.sourceforge.net/[/quote]1 pom 依赖[code="java"] freemarker freemarker 2.3.8 compile [/code]2 工具类[code="java"]pub...原创 2012-10-16 11:54:13 · 113 阅读 · 0 评论 -
perforce java api使用
[quote]perforce是种版本管理软件,提供啦完整的java api,可以方便我们做一些客户化开发,官方文档http://www.perforce.com/product/components/apis[/quote]1 . pom 依赖[code="java"] com.perforce p4java 2011.1.297684 [/code]...原创 2012-10-16 11:43:38 · 702 阅读 · 0 评论 -
常量接口 vs 枚举常量类
把常量定义在接口里与类里都能通过编译,那2者到底有什么区别呢?那个更合理?1. 常量接口[code="java"]public interface ConstInterfaceA { public static final String CONST_A = "aa"; public static final String CONST_C = "ac";}[/code]...原创 2009-08-27 16:49:07 · 448 阅读 · 0 评论 -
Learning EasyMock3.0 By Official Example
[b]Maven Installation[/b]+add following code to pom.xml[code="java"] org.easymock easymock 3.0 test [/code][b]EasyMock Basic Flow[/b][quote] 1 create Mock ob...原创 2011-08-24 16:48:22 · 110 阅读 · 0 评论 -
Spring2集成测试
[b]Spring2测试类继承层次[/b][img]http://dl.iteye.com/upload/attachment/543616/22908a26-8949-37f6-be49-2dea894e858b.gif[/img][b]集成测试例子[/b][code="java"]public class UserServiceIntegrateWithJdbcTest ext...原创 2011-08-25 22:21:59 · 117 阅读 · 0 评论 -
Maven+jetty+jrebel+m2eclipse+eclipse搭建struts2开发环境
[quote]Maven:项目构建工具,通过pom.xml可以自动维护jar包,还有各种项目中常用的plugin,如jetty plugin.Jetty: servlet 容器m2eclipse:maven的eclipse插件,可以搜索依赖jar和插件,编辑pom.xmlJrebel:Rebel is a small JVM-plugin that makes it possible ...原创 2011-08-11 11:18:42 · 154 阅读 · 0 评论 -
HttpClient4登陆ITeye
[code="java"]import java.io.IOException;import java.io.InputStream;import java.util.ArrayList;import java.util.List;import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;...原创 2012-01-08 23:33:43 · 125 阅读 · 0 评论 -
HttpClient4.1.2 & HtmlUnit2.9 处理文件下载
TestCode[code="java"]import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import org.apache.http.HttpResponse;import org.apache...原创 2012-01-09 18:18:22 · 170 阅读 · 0 评论 -
Selenium Web Driver入门
[b]1 What is Selenium?[/b][quote]Selenium automates browsers. That's it. What you do with that power is entirely up to you. Primarily it is for automating web applications for testing purposes, but...原创 2012-05-27 23:17:49 · 164 阅读 · 0 评论 -
Spring3单元测试和集成测试
[quote]本文针对常见的springmvc+spring+springjdbc的架构提供啦一些单元测试和集成测试的范例,附件是完整的demo[/quote][b]示例代码安装: 1 安装maven2 准备mysql数据库,运行脚本: Spring3\schema\sampledb.sql3 maven dbunit:export可以导出数据库数据到export.xm...原创 2011-11-25 18:32:45 · 290 阅读 · 0 评论 -
XPath 入门
[quote]xpath可以快速定位获取XML文件中指定属性和值,jdk包含拉所有需要的类[/quote]1. 帮助类[code="java"]public class XpathUtil { private static final Log logger = LogFactory.getLog(XpathUtil.class.getName()); private Docum...原创 2012-10-16 11:29:07 · 138 阅读 · 0 评论 -
Format XML in JAVA
[code="java"] public static String formatXMLContent(final String message) { try { final InputSource src = new InputSource(new StringReader(message)); ...原创 2016-01-11 12:23:21 · 128 阅读 · 0 评论
分享