存档

2006年11月6日 的存档

using dwr with your spring bean

2006年11月6日 summer 没有评论

In dwr sites, it tell use three way to use dwr with spring. But the important details are ignored on his suggest way.

If you are using spring and have your private spring bean manger.how to use DWR?

  1. define a spring bean implements BeanFactoryPostProcessor
  2. overwrite postProcessBeanFactory function
  3. call SpringCreator.setOverrideBeanFactory(beanFactory)

the code was just like this:

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import uk.ltd.getahead.dwr.create.SpringCreator;
/**  * @author summer  *  */
public class DWRSpringIntegrator implements BeanFactoryPostProcessor {
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        SpringCreator.setOverrideBeanFactory(beanFactory);
    }
}

分类: dwr 标签: