如何在 Spring 中将两个参数值放在一个上下文参数中? [英] How to put two param-values in one context-param in Spring?

查看:36
本文介绍了如何在 Spring 中将两个参数值放在一个上下文参数中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:我有两个 contextConfigLocation 参数,一个带有用于 spring-social-facebook 的 @Configuration 类,另一个带有用于应用程序的 xml-file:

Problem: I have two contextConfigLocation parameters, one with @Configuration classes for spring-social-facebook and one with xml-file for app:

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>com.communicator.core.social.facebook.config</param-value>
</context-param>

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/root-context.xml</param-value>
</context-param>

他们都使用一个param-name,我不知道如何解决它.

Both of them use one param-name, and I don't know how to fix it.

推荐答案

你会试试这个

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/root-context.xml,
        com.communicator.core.social.facebook.config
    </param-value>
</context-param>

这篇关于如何在 Spring 中将两个参数值放在一个上下文参数中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆