- 浏览: 23263 次
- 性别:
- 来自: 深圳
-
最新评论
文章列表
本文内容前面配置从spring3.2.8参考文档摘抄以及自己的理解,后面关于传播级别和隔离的知识点参考自http://www.blogjava.net/freeman1984/archive/2010/04/28/319595.html
一、XML配置(推荐使用XML配置,一次配置可以多处使用,
注解需要每个方法写 @Transactinal)
<!-- from the file 'context.xml' -->
<?xml version="1.0" encoding="UTF-8"?>
<beans x ...
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www. ...
本文从ITEYE中某个问题答案上COPY过来的,非原创。
读取资源文件一般根据上下文环境分为两种情况。
第一种是非WEB应用的环境中,只需要简单的通过类加载器的getResourceAsStream方法读取。
例如,classpath根目录下有一个setting.properties文件,可以这样读取
InputStream is = Thread.currentThread().getClass().getResourceAsStream("/setting.properties");
第二种是WEB应用的环境中,因为应用包含在了Servlet 容器中, ...
以spring3.0为例
一、进入eclipse如下菜单。每个eclipse版本可能有差异,因此可以在preferences里直接搜索XML,找到XML Catalog。
window---preferences--XML--XML Catalog
二、在XML Catalog页面
a.选择“Add”。
b.选中“Catalog Entry”,
c.在"Location"中选择本地XSD地址。如:
"D:\spring-framework-3.2.8.RELEASE\schema\beans\spring-beans-3.0 ...
Jar包和文档下地址:
http://repo.spring.io/release/org/springframework/spring/
源代码下载地址:
https://github.com/spring-projects/spring-framework
可以选择需要的版本,右下角有个按钮“Download ZIP”
本文以Spring3.2.8为例
一、Spring自动装配类型
1.byType
2.byName
二、@Autowired和@Resource的区别
1.@Autowired
a.此注解属于spring实现的注解。
b.默认装配类型为byType。如果同时存在多个同 ...
本文以struts2.3.16.1为例。
一、运行jar包
A.asm-3.3.jar
B.asm-commons-3.3.jar
C.commons-fileupload-1.3.1.jar(文件上传必须插件)
D.commons-io-2.2.jar(文件上传必须插件)
E.commons-lang3-3.1.jar
F.freemarker-2.3.19.jar
G.javassist-3.11.0.GA.jar
H.ognl-3.0.6.jar
I.struts2-convention-plugin-2.3.16.1.jar(使 ...
步骤:
1、eclipse中新建JAVA项目,将源代码导入工程,添加依赖的jar包,编译通过。
2、在桌面新建目录doc
3、在eclipse中选中工程,选择菜单Project---Generate Javadoc
a.选中工程。
b.选中"Use Standard doclet",Destination中选中刚才新建的目录doc
c."Document title"中填写名字,如:struts2.0
d.选中所有引用的JAR包。
4、点击完成,在doc目录下生成了html格式的API文档。
5、安装htmlhelp。(按提示操作即 ...
package org.test.sftp;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.commons.io.IOUtils;
import org.apache.commons.vfs.FileSystemException;
import org.apache.commons ...
package org.test.ftp;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.commons.io.IOUtils;
import org.apache.commons.net.ftp.FTPClient;
import org.test.LogUtil;
/**
* The FTP client utility class.
*/
public class MyFtpC ...
package com.coship.locktest;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
public class CountDownLatchTest {
/**
* @param args
*/
public static void main(String[] args) {
/*
* try { new CountDownLatc ...
本文代码来自传智播客PPT
GET方法:
利用HttpURLConnection对象,我们可以从网络中获取网页数据.
/**
* Get 请求
*
* @param reqUrl
* @return String
*/
public static String get(String reqUrl) {
logger.info("GET Request,Url:" + reqUrl);
InputStream is = null;
HttpURLConnection conn = null;
String resu ...
为当前用户创建cron服务
1. 键入 crontab -e 编辑crontab服务文件
例如 文件内容如下:
*/2 * * * * /bin/sh /home/admin/jiaoben/buy/deleteFile.sh
保存文件并并退出
*/2 * * * * /bin/sh /home/admin/jiaoben/buy/deleteFile.sh
*/2 * * * * 通过这段字段可以设定什么时候执行脚本
/bin/sh /home/admin/jiaoben/buy/deleteFile.sh 这一 ...
操作系统分类
unix:IBM aix,sun solaris,hp unix,free BSD等等
linux:redhat,suse,红旗等等
关机命令
shutdown -h -now 立即关机
shutdown -r -now 立即重启
reboot 立即重启
目录大概作用
root:存放root用户相关文件
home:存放普通用户相关文件或者FTP站点目录
bin:存放常用命令目录
sbin:具有一定权限才能使用的命令
mnt:默认挂载光驱与软驱的目录
boot:存放引导相关文件
etc:存放配置相关文件
var:存放经常变化的文件,如log
usr:安装程序 ...