web动态加载spring.xml对象怎么取?
在Web 工程中启动Spring 2.0的三种方法:就说配置了,在java中如何取得加载的对象?比如 ctxApplicationContext ctx=newFileSystemXmlApplicationContext("bean.xml");Action action = (Action) ctx.... 展开
其他答案
在有Spring环境的工程中的普通类继承org.springframework.remoting.jaxrpc.ServletEndpointSupport,然后覆盖onInit()方法在这个方法里面就是完成获得Spring容器中的对象(当然这个对象是在Spring容器中 的)这种形式可以放在任何类中,普通类也就可以获得Spring环境中的bean
2011-01-21 06:34
来自北京市
赞(0)点赞赞(0)举报
免责声明:问答内容均来源于互联网用户,房天下对其内容不负责任,如有版权或其他问题可以联系房天下进行删除。




