• About
  • Trade
  • Science
  • Eclipse
  • Software
  • Infoq
  • T
  • Projects
  • Contact
  • Thinks
  • | Log in |

    using dwr with your spring bean

    2006年11月6日 PM 15:41 | 作者: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);
        }
    }

    发表评论

    *必填

    *必填 (不会被公开)