为了账号安全,请及时绑定邮箱和手机立即绑定

请问各位如何在controller中获取application-context.xml的bean

请问各位如何在controller中获取application-context.xml的bean

森林海 2019-03-01 10:31:58
这是webxml中的配置 <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:application-context.xml </param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>example</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>example</servlet-name> <url-pattern>/api/*</url-pattern> </servlet-mapping> 如何通过controller中获取bean,如果使用ClassPathApplicationContext获取会报错,请问该怎么办啊?各位大哥谁能帮一下啊
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 988 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号