自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(44)
  • 收藏
  • 关注

转载 SpringMVC关于json、xml自动转换的原理研究[附带源码分析 --转

SpringMVC关于json、xml自动转换的原理研究[附带源码分析]原文地址:http://www.cnblogs.com/fangjian0423/p/springMVC-xml-json-convert.html目录前言现象源码分析实例讲解关于配置总结参考资料前言SpringMVC是目前主流的Web MVC框架之一。...

2015-01-31 18:53:00 73

转载 使用split进行分割时遇到特殊字符的问题

使用split分割时:String[] a="aa|bb|cc".split("|");output:[a, a, |, b, b, |, c, c]先看一下split的用法: String[] java.lang.String.split(String regex)Splits this string around matches of th...

2015-01-31 18:52:00 479

转载 FastJSON应用前测试--转载

FastJSON 应用前测试FastJSON是一个很好的java开源json工具类库,相比其他同类的json类库,它的速度的确是fast,最快!但是文档做得不好,在应用前不得不亲测一些功能。实际上其他的json处理工具都和它差不多,api也有几分相似。一、JSON规范JSON是一个标准规范,用于数据交互,规范的中文文档如下:http://www.js...

2015-01-29 11:48:00 62

转载 linux http请求监控工具httpry---官方文档

原文地址:http://dumpsterventures.com/jason/httpry/core programhttpry is a specialized packet sniffer designed for displaying and logging HTTP traffic. It is not intended to perform analysis itsel...

2015-01-28 13:54:00 643

转载 Spring – Sending E-Mail Via Gmail SMTP Server With MailSender--reference

Spring comes with a useful ‘org.springframework.mail.javamail.JavaMailSenderImpl‘ class to simplify the e-mail sending process via JavaMail API. Here’s a Maven build project to use Spring’s ‘Java...

2015-01-27 19:51:00 233

转载 非spring环境中配置文件工具

http://commons.apache.org/proper/commons-configuration/注意:属性的值使用","分割,会造成读取属性值不正确的问题。建议使用":"代替。原因:暂时没有时间读源码,等稍微闲一些的时候会研究。用户手册:https://commons.apache.org/proper/commons-configuration/userg...

2015-01-26 20:47:00 77

转载 Spring + JDK Timer Scheduler Example--reference

http://www.mkyong.com/spring/spring-jdk-timer-scheduler-example/In this example, you will use Spring’s Scheduler API to schedule a task.1. Scheduler TaskCreate a scheduler task…pac...

2015-01-26 15:13:00 67

转载 Referenced file contains errors (http://www.springframework.org/schema...错误--转载

Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-3.0.xsd).关于这个错误,导致的原因可能是一种可能是之前用的Spring版本,和现在用的不同对于Eclipse编译器来说,会有个缓存,这样验证的时候他会告诉你版本不统一Preferences -...

2015-01-26 11:07:00 70

转载 Java多线程编程模式实战指南(三):Two-phase Termination模式--转载

本文由本人首次发布在infoq中文站上:http://www.infoq.com/cn/articles/java-multithreaded-programming-mode-two-phase-termination。转载请注明作者: 黄文海 出处:http://viscent.iteye.com。停止线程是一个目标简单而实现却不那么简单的任务。首先,Java没有提供直接的...

2015-01-25 22:14:00 86

转载 Java多线程编程模式实战指南(二):Immutable Object模式--转载

本文由本人首次发布在infoq中文站上:http://www.infoq.com/cn/articles/java-multithreaded-programming-mode-immutable-object。转载请注明作者: 黄文海 出处:http://viscent.iteye.com。多线程共享变量的情况下,为了保证数据一致性,往往需要对这些变量的访问进行加锁。而锁本身...

2015-01-25 22:12:00 95

转载 Improving Lock Performance in Java--reference

After we introducedlocked thread detectiontoPlumbrcouple of months ago, we have started to receive queries similar to “hey, great, now I understand what is causing my performance issues, but ...

2015-01-23 09:51:00 76

转载 The 10 Most Important Security Controls Missing in JavaEE--reference

JavaEE has some excellent built-in security mechanisms, but they don’t come close to covering all the threats that your applications will face. Many common attacks like Cross-Site Scripting (XSS...

2015-01-23 09:44:00 109

转载 从源码角度深入分析log4j配置文件使用

log4j在日常开发中经常使用,但有时候对 配置文件应该放到什么位置有疑惑。现在我们通过从代码的角度来看待这个问题,看完后你也许会恍然大悟哦。开始吧。Log4j的组成及架构: Log4j由三个重要的组成构成:日志记录器(Loggers),输出端(Appenders)和日志格式化器(Layout)。1.日志记录器(Loggers):控制要输出哪些日志记录语句,对日志信息进...

2015-01-23 06:31:00 80

转载 log4j.properties文件配置--官方文档

Default Initialization ProcedureThe log4j library does not make any assumptions about its environment. In particular, there are no default log4j appenders. Under certain well-defined circumstan...

2015-01-22 09:34:00 203

转载 JS问题Uncaught ReferenceError:XXXX is not defined

背景:html中一个table,table中进行分页。每行后面有一系列操作,如删除,修改。现在以删除为例说明问题。实现方式:使用button,在onclick中调用js函数,js函数中传递参数如用户ID,用户姓名等。<button id="delete" type="button" onclick="delete(<c:out value="${vo.user...

2015-01-21 15:25:00 1339

转载 kafka 集群--3个broker 3个zookeeper创建实战

准备工作:1. 准备3台机器,IP地址分别为:192.168.0.10,192.168.0.11,192.168.0.122. 下载kafka稳定版本,我的版本为:kafka_2.9.2-0.8.1.1.tgz3. 分别解压放入到想安装的目录下,我的目录为:/home/www 解压命令为:tar -xzf kafka_2.9.2-0.8.1.1.tgz搭建zooke...

2015-01-21 14:45:00 154

转载 Linux ps aux指令詳解--转

linux上进程有5种状态:1. 运行(正在运行或在运行队列中等待)2. 中断(休眠中, 受阻, 在等待某个条件的形成或接受到信号)3. 不可中断(收到信号不唤醒和不可运行, 进程必须等待直到有中断发生)4. 僵死(进程已终止, 但进程描述符存在, 直到父进程调用wait4()系统调用后释放)5. 停止(进程收到SIGSTOP, SIGSTP, SIGTIN, SIG...

2015-01-21 13:49:00 69

转载 quartz源码分析之深刻理解job,sheduler,calendar,trigger及listener之间的关系

org.quartz包包org.quartz是Quartz的主包,包含了客户端接口。其中接口有:Calendar接口:定义了一个关联Trigger可能(或者不可能)触发的时间空间。它没有定义触发的真实时间,而是用在在普通的Schedule需要限制Trigger触发的时候。大部分Calendar包含默认所有的时间,并且用户去排除部分时间。因而,可以把Calendar看做...

2015-01-21 08:09:00 184

转载 kafka入门:简介、使用场景、设计原理、主要配置及集群搭建--转载

问题导读:1.zookeeper在kafka的作用是什么?2.kafka中几乎不允许对消息进行“随机读写”的原因是什么?3.kafka集群consumer和producer状态信息是如何保存的?4.partitions设计的目的的根本原因是什么?一、入门 1、简介 Kafka is a distributed,partitioned,re...

2015-01-20 14:10:00 79

转载 Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing--...

原文:http://blog.csdn.net/sunny2038/article/details/6926079最近在看Java,在编译写书上一个例子时,由于书上的代码只有一部分,于是就自己补了一个内部类。结果编译时出现:No enclosing instance of type E is accessible. Must qualify the allocation with a...

2015-01-20 14:08:00 53

转载 Glossary of Terms in the JavaTM platform --reference

http://docs.oracle.com/javase/tutorial/information/glossary.htmlfield:A data member of a class. Unless specified otherwise, a field is not static.member:Afieldormethodof a class. Unless ...

2015-01-19 21:20:00 88

转载 spring core源码解读之ASM4用户手册翻译之一asm简介

第一章:ASM介绍1.1 ASM动机:程序的分析,生成,转换技术可以应用到许多场景:1.程序分析,从简单的语法解析到完整的语义分析,可以应用在程序中找到潜在的bug,发现无用的代码,工程代码的逆向等等。2.代码生成应用在各种编译器中:既包括传统的编译器也包括分布式编程的stub或者skeleton编译器,即时编译器等等。3. 代码转换,可用于优化或混淆程序...

2015-01-18 21:33:00 99

转载 注释驱动的 Spring cache 缓存介绍--转载

概述Spring 3.1 引入了激动人心的基于注释(annotation)的缓存(cache)技术,它本质上不是一个具体的缓存实现方案(例如 EHCache 或者 OSCache),而是一个对缓存使用的抽象,通过在既有代码中添加少量它定义的各种 annotation,即能够达到缓存方法的返回对象的效果。Spring 的缓存技术还具备相当的灵活性,不仅能够使用 SpEL(Sprin...

2015-01-17 22:17:00 75

转载 AOP 的利器:ASM 3.0 介绍

引言什么是 ASM ?ASM 是一个 Java 字节码操控框架。它能被用来动态生成类或者增强既有类的功能。ASM 可以直接产生二进制 class 文件,也可以在类被加载入 Java 虚拟机之前动态改变类行为。Java class 被存储在严格格式定义的 .class 文件里,这些类文件拥有足够的元数据来解析类中的所有元素:类名称、方法、属性以及 Java 字节码(指令)。...

2015-01-17 08:29:00 64

转载 字符串比较报错

今天要归档日志时发现要排除当日的日志不能归档,gz -9 $filename 但发现没有--exclude 选项,故选择使用判断语句进行排除特定文件名。但使用if ..then ..fi 判断字符串是否相等时报错:syntax error near unexpected token `then'原因:if 与‘['之间没有加空格导致的。完整判断shell 如下:...

2015-01-15 17:03:00 119

转载 spring beans源码解读之--总结篇

spring beans下面有如下源文件包:org.springframework.beans, 包含了操作java bean的接口和类。org.springframework.beans.annotation, 支持包,提供对java 5注解处理bean样式的支持。org.springframework.beans.factory, 实现spring轻量级IoC容器的核心包。org...

2015-01-15 11:51:00 223

转载 Performing a thread dump in Linux or Windows--reference

Linux/Unix1. Find the Java/Tomcat process id.% ps ax | grep javaYou should see output like this17207 ? Sl 78:36 /usr/java/default/bin/java -Djava.util.logging.conf...

2015-01-14 16:12:00 88

转载 Linux 精准获取进程pid--转

如果想在脚本里只获取PID,那么可以用如下脚本。目前收集两种方法:方法一$ps x|grep xxx |awk '{print $1}'e.g. ps x|grep java|awk '{print $1}'注释: 1、xxx为执行的命令名称 2、举个例子,获取当前用户下的java进程 【pid】...

2015-01-14 15:59:00 335

转载 /bin/bash^M: bad interpreter: 没有那个文件或目录--转载

运行脚本时出现了这样一个错误,打开之后并没有找到所谓的^M,查了之后才知道原来是文件格式的问题,也就是linux和windows之间的不完全兼容。。。具体细节不管,如果验证:vim test.sh:set ff?如果出现fileforma=dos那么就基本可以确定是这个问题了。:set fileformat=unix:wqOK了。。。。。。。bash: ./eth0-acces...

2015-01-14 15:55:00 58

转载 linux 进程综合指令

1. 查询当前机器运行的进程总数:ps -ef | wc -lps -ef | grep httpd | wc -l2. ulimit命令表 1. ulimit 参数说明选项 [options]含义例子-H设置硬资源限制,一旦设置不能增加。ulimit – Hs 64;限制硬资源,线程栈大小为 64K。-S设置...

2015-01-12 21:51:00 49

转载 Sending e-mail with Spring MVC---reference

reference from:http://www.codejava.net/frameworks/spring/sending-e-mail-with-spring-mvcTable of contents:1.Spring framework’s support for e-mail2.Required jar files3.Creating e-mail sendi...

2015-01-12 16:01:00 372

转载 Spring XD 1.1 M2 and 1.0.3 released---support kafka

官方地址:http://spring.io/blog/2014/12/23/spring-xd-1-1-m2-and-1-0-3-releasedOn behalf of the Spring XD team, I am very pleased to announce the second milestone release of Spring XD 1.1 and the 1.0...

2015-01-10 22:58:00 79

转载 How to manage and balance “Huge Data Load” for Big Kafka Clusters---reference

1. Add Partition ToolPartitions act as unit of parallelism. Messages of a single topic are distributed to multiple partitions that can be stored and served on different servers. Upon creation o...

2015-01-10 22:56:00 82

转载 JDBC Transaction Management Example---reference

In this post, we want to talk about JDBC Transactions and how we can manage the operations in a database.The most popular DBMS like MySQL and Oracle have by default the option autocommit enable...

2015-01-10 22:55:00 84

转载 Intra-cluster Replication in Apache Kafka--reference

Kafkais a distributed publish-subscribe messaging system. It was originally developed at LinkedIn and became an Apache project in July, 2011. Today,Kafka is used byLinkedIn, Twitter, and Squar...

2015-01-10 22:47:00 90

转载 Load Balance Tomcat with Nginx and Store Sessions in Redis--reference

An awkward title, but that’s exactly what we’re going to do. For some time, I was looking for a way to push code to production systems with zero downtime and zero impact to any active users. Surp...

2015-01-10 22:25:00 75

转载 spring beans源码解读之--XmlBeanFactory

导读:XmlBeanFactory继承自DefaultListableBeanFactory,扩展了从xml文档中读取bean definition的能力。从本质上讲,XmlBeanFactory等同于DefaultListableBeanFactory+XmlBeanDefinitionReader ,如果有更好的需求,可以考虑使用DefaultListableBeanFactor...

2015-01-08 11:19:00 93

转载 Quartz Enterprise Job Scheduler 1.x Tutorial---转载

Lesson 10: Configuration, Resource Usage and SchedulerFactoryhttp://www.quartz-scheduler.org/documentation/quartz-1.x/tutorials/TutorialLesson10The architecture of Quartz is modular, and ther...

2015-01-06 17:25:00 92

转载 项目中使用Quartz集群分享--转载

原文:http://hot66hot.iteye.com/blog/1726143在公司分享了Quartz,发布出来,希望大家讨论补充.CRM使用Quartz集群分享一:CRM对定时任务的依赖与问题二:什么是quartz,如何使用,集群,优化三:CRM中quartz与Spring结合使用1:CRM对定时任务的依赖与问题1)依赖(1)每天晚上的定时任务,通过sql脚本 +...

2015-01-06 11:07:00 127

转载 quartz集群调度机制调研及源码分析---转载

quartz2.2.1集群调度机制调研及源码分析引言quartz集群架构调度器实例化调度过程触发器的获取触发trigger:Job执行过程:总结:附:引言quratz是目前最为成熟,使用最广泛的java任务调度框架,功能强大配置灵活.在企业应用中占重要地位.quratz在集群环境中的使用方式是每个企业级系统都要考虑的问题.早在2006年,在ITeye上就有一篇关于qurat...

2015-01-06 09:25:00 74

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除