`
文章列表
Overview I’ve been asked several times to explain the difference between injecting Spring beans with ‘@Resource’, ‘@Autowired’, and ‘@Inject’. While I received a few opinions from colleagues and read a couple of posts on this topic I didn’t feel like I had a complete picture. Annotations Annot ...

使用Nexus创建私服

1.下载并且解压缩    2.添加NEXUS_HOME和Path    3.nexus intall将nexus安装到windows-x86-32服务中,双击install-nexus.bat   4.nexus start & stop   5.在nexus服务启动后,可以输入http://localhost:8081/nexus,就能看到Nexus的界面   6.登录Nexus,admin/admin123   7.更新私有仓库的索引 先选中Central,切换到Configuration页签,将Download Remote Indexes设置为tru ...
1.Maven Dependency <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</model ...

Spring JDBC CRUD

1.Maven Dependency <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</mode ...
Effective Java • Creating and Destroying Objects创建和销毁对象 1. Consider static factory methods instead of constructors 考虑用静态工厂方法代替构造器 2. Consider a builder when faced with many constructor parameters 遇到多个构造器参数时要考虑用构建器 3 ...
Agile Design 敏捷设计 The Single-Responsibility Principle (SRP) 单一职责原则 A class should have only one reason to change. 就一个类而言,应该仅有一个引起它变化的原因。   The Open/Closed Principle (OCP) 开放-封闭原则 Software entities(classes, modules, functions, etc.) should be open for extension but closed for modification. ...
1.cmd java -jar wls1211_generic.jar   2.Welcome  3.Choose Middleware Home Directory  4.Register for Security Updates  5.Choose Install Type  6.JDK Selection  7.Choose Product Installation Directories   8.Choose Shortcut Location  9.Installation Summary  10.Installing...  11.Installation ...

clone() 方法

    博客分类:
  • Java
在应用开发过程中,我们可能会需要拷贝(copy)一个现有的对象,即得到一个新对象并希望其与现有对象封装完全相同的信息(属性值),主要是为了此后两者互不相干,修改其中的一个对象不会影响到另外一个。简单地引用变量间的赋值是不能解决问题的,因为并没有创建新对象;而自己编写代码先创建一个新对象,再将原始对象的属性一一复制过来也比较繁琐,且存在“浅度拷贝”问题;这种情况下,利用clone() 方法来实现对象拷贝不失为一种明智的选择。   Object类中的clone()方法专门提供拷贝当前对象的功能,其原型如下: /** * Creates and returns a copy ...

多线程实现方法

    博客分类:
  • Java
两种实现方法: 继承Thread类, 实现Runnable接口 Thread类是Runnable接口的子类 使用Runnable接口可以实现资源共享的目的 所有的线程操作都必须通过Thread类的start()方法启动   package org.fool.thread; public class ThreadTest { public static void main(String[] args) { Thread thread1 = new Thread01(); Thread thread2 = new Thread(new Thread ...

JSP Demo

In the early days, servlets were the only API available to develop server-side web applications in Java. Servlets had a number of advantages over CGI scripts, which were (and to some extent, still are) prevalent in those days. Some of the advantages of servlets over CGI scripts included increased p ...
Hibernate 3 1.Maven Dependency <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4 ...

Servlet 3.0 Demo

A servlet is a Java class that is used to extend the capabilities of servers that host applications. Servlets can respond to requests and generate responses. The base class for all servlets is javax.servlet.GenericServlet. This class defines a generic, protocol-independent servlet. 1.Maven Depende ...

Hello Lucene

1.Maven Dependency <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</mode ...

JUnit 4 Demo

1.Maven Dependency <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</model ...

JUnit 3 Demo

1.Maven Dependency <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</model ...
Global site tag (gtag.js) - Google Analytics