2008-08-19

java 对象转换

关键字: blob serializable
1.序列化与反序列化 private Blob msg; private Serializable serialiableMsg; public Serializable getSerialiableMsg() throws SQLException { InputStream is = getMsg().getBinaryStream(); serialiableMsg = (is == null) ? null : (Serializable) SerializationUtils.serialize(is); return serialiableMsg; } ...
2008-08-18

activemq错误收集

关键字: activemq error
1.DefaultMessageListenerContainer stops consuming after inactivity Example exception trace repeated in logs [ERROR] 2008-08-12 15:16:57 method: org.springframework.jms.listener.DefaultMessageListenerContainer.handleListenerSetupFailure(DefaultMessageListenerContainer.java:666) Setup of JMS me ...
2008-07-15

spring jdbcTemplate使用

关键字: spring jdbctemplate
(1)springJdbcContext.xml <?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:aop="http://www.springframework.org/sch ...
2008-07-11

spring使用RMI暴露服务

关键字: spring rmi
(1)定义接口: package com.logcd.spring.rmi; public interface HelloService { public String doHello(String name); } (2)接口实现: package com.logcd.spring.rmi; public class HelloServiceImpl implements HelloService{ public String doHello(String name) { return "Hello , " + name; } } (3)r ...
2008-07-10

Spring2.X以AspectJ 式AOP 配置事务

关键字: spring 事务
(1)配置: Spring的事务管理是通过AOP代理实现的,其中的事务通知由元数据驱动。代理对象与事务元数据结合产生一个AOP代理,它使用一个PlatformTransactionManager实现,配合TransactionInterceptor,在方法调用前后实施事务。 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-inst ...
2008-07-08

spring 事务管理

关键字: spring 事务
声明式的事务管理(Declarative transaction management): <1>事务配置方式: <!-- dataSource for MySQL --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" ...
2008-07-04

Apache Commons Configuration

关键字: apache commons
Apache Commons-configuration (1)如果要使用configuration这个包,首先要保证使用JDK1.2以上,还要引入如下jar包 commons-beanutils commons-lang commons-logging commons-collections commons-digester commons-codec commons-jxpath (2)commons-configuration最新的版本是1.5,最主要的作用是读取资源文件,每一种文件格式都有一个对应的类,如下 properties文件--PropertiesCon ...
2008-07-04

prototype Ajax对象

关键字: ajax对象
(1)Ajax.Request类 假如你有一个应用程序可以通过url http://yoursever/app/get_sales?empID=1234&year=1998与服务器通信。 <script> function searchSales(){ var empID=$F('lstEmployees'); var y=$F('lstYears'); var url='http://yoursever/app/get_sales'; var pars='empID='+empID+'&year='+y; ...
2008-07-04

prototype 实用的函数

关键字: prototype
(1)$()方法 document.getElementById() 方法的一个便利的简写,就像这个 DOM 方法一样,这个方法返回参数传入的 id 的那个元素。可以传入多个 id 作为参数然后 $() 返回一个带有所有要求的元素的一个 Array 对象。 example: var d=$('myDiv'); alert(d.innerHTML); var divs=$('myDiv','myOtherDiv'); for(i=0;i<divs.length;i++){ alert(divs[i].innerHTML); ...
2008-07-04

spring with buffalo

关键字: spring buffalo
AJAX:Asynchronous JavaScript and XML (1)buffalo.xml:配置与spring service对应关系 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean name="buffaloConfigBean" class="net.buffalo.serv ...