html转xml
用jtidy. 关键语句: tidy.setXmlOut(true);
用jtidy. 关键语句: tidy.setXmlOut(true);
"The SchemaFactory class is not thread-safe. In other words, it is the application’s responsibility to ensure that at most one thread is using a SchemaFactory object at any given moment" See: http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/validation/SchemaFactory.html
Rod Johnson 说load测试未必要针对整个Application才能做,我们也可以针对单个业务对象来测。具体该怎么玩我还没玩,这里先记录一些工具名: 1.Grinder 2.Rod自己写的一个无界面的工具包:com.interface21.load
1. JVM Profiling Option "starting a Sun Java 1.3 JVM with the following arguments will cause it to dump profile output when it quits: -Xrunhprof:cpu=samples,thread=y" 2. JProbe
据说遇到BUG时要先写个单元测试代码来复现这个BUG,等bug fix后再来跑一下这段测试代码,跑通了才表示bug已经解决。为什么泥?
抄自Rod Johnson’s ‘Expert+One-on-One+J2EE+Design+And+Development’ 1.Mock一个DAO接口,测试时不去真正地访问数据库 2.但有时我们的确想测试一下真正的数据库操作,这是可以理解的,但要注意保证测试的可重复性。一般来说,可以这样: a.应在测试目标操作前插入一些初始数据以供测试 b.测试目标方法 c.测试目标方法之后应清空之前插入的初始数据
Testing enterprise applications poses many challenges: Enterprise applications usually depend on resources such as databases, which will need to be considered in any testing strategy. Testing web applications can be difficult. They don’t expose simple Java interfaces that we can test, and unit testing is complicated by the dependence of web tier components …
What this Book Covers This book covers: How to make key J2EE architectural choices, such as whether to use EJB and where to implement business logic J2EE web technologies, and effective use of the Model-View-Controller (MVC) architectural pattern in web applications How to use EJB 2.0 effectively, including the implications of the …
正如 http://hi.baidu.com/pmzcn/blog/item/aeab6e63c58762600d33fa21.html所说,spring 2.5中,这个类在解析路径时会把context path带进去! 我的解决办法是,自己做一个UrlFilenameViewController类,在这个类中照抄spring 2.0 UrlFilenameViewController的代码(如果下不到源代码,反编译一下也可以,我就是通过反编译搞到代码的)
MessageFormat.format("Hi, {0} {1}", "朱", "元璋"); //Hi, 朱 元璋 MessageFormat.format("Hi, ‘{0}’ {1}", "朱", "元璋"); //Hi, {0} 元璋 MessageFormat.format("Hi’, {0} {1}", "朱", "元璋"); //Hi, {0} {1} MessageFormat.format("Hi, {0} {1}", "’朱’", "元璋"); //Hi, ‘朱’ 元璋