Topic: spring:在web服务里如何根据spring配置文件获取applicationContext?

  Print this page

1.spring:在web服务里如何根据spring配置文件获取applicationContext? Copy to clipboard
Posted by: benbon
Posted on: 2005-12-02 15:07

我想在Web服务里的Sevlet或由Servlet调用的JavaBean里根据配置文件用FileSystemXmlApplicationContext或ClassPathXmlApplicationContext获取一个ApplicationContext对象是否可以,请问该怎么做,例如把配置文件放在哪里,路径怎么设置?

2.Re:spring:在web服务里如何根据spring配置文件获取applicationContext? [Re: benbon] Copy to clipboard
Posted by: floater
Posted on: 2005-12-04 10:04

not sure I understand your question. In general, there is no need to get the ApplicationContext in the servlet container when using spring mvc. In rare cases, if needed, there are two ways to get it, one is using the utility class in Spring to get it from the webapplicationcontextutils class, another is to implement applicationcontextaware interface.


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923