腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
1
回答
Spring
PropertySourcesPlaceholderConfigurer
beans
:
在运
行时
解析
属性
值
java
、
spring
、
properties
、
spring-properties
我正在使用多个
PropertySourcesPlaceholderConfigurer
beans
加载
属性
,并设置占位符前缀-es: @Bean
PropertySourcesPlaceholderConfigurer
propertySourcesPlaceholderConfigurer
= new
PropertySo
浏览 17
提问于2020-10-30
得票数 0
回答已采纳
3
回答
我如何告诉
Spring
使用Java映射来
解析
属性
占位符?
java
、
spring
我有一个Map<String, String>,我想告诉
Spring
在创建bean和
解析
属性
占位符时使用它。做这件事最简单的方法是什么?
浏览 5
提问于2015-06-07
得票数 6
回答已采纳
1
回答
Spring
如何用环境变量替换${}?
java
、
spring
、
spring-mvc
、
dependency-injection
、
spring-bean
" value="classpath*:META-INF/*-config.properties" />下面是我的 import org.springframework.context.support.
PropertySourcesPlaceholderConfigurer
这里是我的tomcat上下文,它在环境变量下向config_path 注入了 C:/myFolder 的
值
。当我启动服务器时,我看到setOverridi
浏览 0
提问于2018-03-30
得票数 1
2
回答
解析
@PropertySource中的占位符
java
、
spring
我正在尝试使用@PropertySource注释从文件中加载应用程序
属性
的配置类,但是
PropertySourcesPlaceholderConfigurer
似乎没有设置从注释接收到的位置。}应用程序
属性
文件是:我收到了以下例外: ……导致: java.lang.IllegalArgumentException:无法
解析
字符串
值
"${just.a.string$2.resolveStringValue(
PropertySourcesPlace
浏览 5
提问于2015-06-10
得票数 2
回答已采纳
1
回答
弹簧不加载特性
java
、
spring
、
properties-file
在@Configuration类中引用applicationContext.xml时,
Spring
不加载
属性
@ImportResource("classpath:applicationContext.xml@5c001eb0: defining
beans
[placeholderConfig,myBean1]; root of factory hierarchy 我没有问题从
属性
文件中加载“test.properties”
值
为${name}和{age}的myBe
浏览 3
提问于2015-05-30
得票数 2
回答已采纳
5
回答
自动修剪加载到
Spring
中的Props文件中
属性
的尾随空白
java
、
spring
、
configuration
、
properties
我使用PropertiesFactoryBean从一个典型的
属性
文件加载
属性
。有没有办法让
Spring
自动从prop
值
中去掉尾随的空格?
浏览 0
提问于2011-08-12
得票数 8
回答已采纳
3
回答
如何在Java
Spring
MVC应用中读取
属性
(或任何其他文本)文件?
java
、
spring-mvc
我需要在
Spring
MVC应用程序中读取java
属性
文件,但我找不到这样做的方法。我在SO上尝试了几个类似问题的答案,但没有成功。我刚接触Java,尤其是
Spring
MVC,所以我可能搞砸了一些东西。 我不再确定该文件是否已成功部署。我正在使用Tomcat btw。
浏览 2
提问于2013-10-09
得票数 3
1
回答
spring
-早于
解析
属性
placeHolder的负载数据源bean
spring-boot
、
spring-cloud
在我将
spring
-cloud-context jar导入我的
spring
-boot2项目中之后,它无法
解析
我的数据源bean "org.apache.tomcat.jdbc.pool.DataSource“配置中的
属性
placeHolder。但是成功
解析
了其他bean配置中的相同
属性
placeHolder。 像"com.alibaba.druid.pool.DruidDataSource“这样的其他数据源bean也有同样的问题。
spring
-clo
浏览 2
提问于2018-06-26
得票数 0
1
回答
Spring
context:
属性
占位符无法
解析
嵌套变量
spring
、
spring-integration
我有两个项目-- project-web和project-service,它们都使用
Spring
core 3.1.3,并具有从相应
属性
文件加载
属性
的配置:org.springframework.
beans
.factory.BeanDefinitionStoreException:类路径资源META-INF/
spring
/applicationContext-data.xml(PlaceholderConfigurer
浏览 0
提问于2013-02-07
得票数 0
8
回答
Spring
无法
解析
占位符
java
、
spring
执行下列代码时会引发错误:import ca.virology.lib2.config.
spring
.PropertiesConfig;import org.slf4j.LoggerFactory;{
浏览 9
提问于2015-02-03
得票数 38
回答已采纳
3
回答
bean的class
属性
中的
属性
占位符
java
、
spring
我和我的一个同事正在玩下面的
spring
配置: <context:property-placeholder location='classpath:/configuration.properties'/></
beans
> 我们希望能够提供一个特定于环境的myBean实现。当我运行代码时,我会
浏览 0
提问于2014-02-12
得票数 1
1
回答
在
Spring
应用程序中加载内部(类路径)和外部
属性
文件
java
、
spring
、
spring-mvc
我需要在我的
spring
应用程序中加载外部和内部
属性
文件。但是,与我的类路径中的
属性
文件相关的所有
属性
都无法
解析
。** <!property name="location"> </property> 我正在获取外部
属性
文件的
属性</em
浏览 1
提问于2014-04-15
得票数 2
回答已采纳
2
回答
获取
Spring
属性
占位符的列表及其
解析
值
java
、
spring
、
spring-boot
我想让运行中的
Spring
(Boot)应用程序的所有
属性
占位符及其
解析
值
都可用于进程监视。应该考虑使用
属性
占位符的所有
属性
(隐式/显式)。 动机:通常在操作过程中很难知道已解决的
属性
的
值
。系统
属性
或命令行参数是“可见的”,但例如代码中隐藏的默认
值
(如@Value("${timeout:30000}"))很难找到。我想回答一个问题:“正
在运
行的应用程序的配置是什么样的?
浏览 6
提问于2016-09-05
得票数 2
回答已采纳
4
回答
在
Spring
中将默认
属性
值
指定为NULL
spring
、
properties
、
null
、
default-value
我想在
Spring
XML配置文件中定义默认
属性
值
。我希望此默认
值
为null。...是否有可能在
Spring
XML配置中为
属性
定义null默认
值
?
浏览 3
提问于2013-05-24
得票数 35
回答已采纳
2
回答
@Value不配置静态
PropertySourcesPlaceholderConfigurer
即可工作
java
、
spring
我正在尝试理解@PropertySource注释在不使用@Autowiring和
Spring
类时的行为。我试图
在运
行时
使用@Value从
属性
文件中注入
值
。我们什么时候需要
PropertySourcesPlaceholderConfigurer
,什么时候不需要?this.name = name;AppConfig.java - import org.springframework.
beans<
浏览 6
提问于2017-04-08
得票数 9
回答已采纳
1
回答
在
Spring
3.1应用程序中访问PropertySources
java
、
spring
、
properties
、
applicationcontext
我使用
Spring
将PropertySources添加到环境中。在将
属性
加载到PropertySources中时,我已经验证了该部分是否正常工作。我正在努力的部分是弄清楚如何访问
Spring
XML配置中加载到ApplicationContextInitializer中的
属性
值
以及Java代码本身。第一个失败是因为我没有在我的
Spring
配置文件中显式地加载jdbc.properties (这就是我的意图)。后者失败了,因为它找不到external bean。我遗漏了哪一步?如何公开从外
浏览 2
提问于2014-03-18
得票数 1
3
回答
在
Spring
PropertyPlaceHolderConfigurer中重写系统
属性
以进行集成测试
spring
我使用一个系统
属性
来定义特定于环境的
属性
文件的位置。但是,对于集成测试,我想将该
值
重写为不同的
值
。<--
Spring
configuration in file service-
spring
-
beans
.xmlignoreResourceNotFound"
浏览 3
提问于2013-07-19
得票数 1
回答已采纳
1
回答
Spring
访问配置-使用@ AlreadyBuiltException设置变量时的
值
spring
、
spring-security
、
properties
、
spring-boot
、
spring-annotations
我正在使用
Spring
Security实现ldap身份验证。当我在下面的配置类中硬编码所有ldap服务器信息时,它可以工作。userDn);然而,当我再次运行它时,应用程序无法启动,并出现以下错误: org.springframework.
beans
.factory.BeanCreationExceptionCaused by: org.springframework.
beans
.BeanInstantiationException: Failed to
浏览 0
提问于2016-04-21
得票数 0
1
回答
如何在春季访问使用applicationcontext.xml文件提交的
属性
文件?
java
、
spring
、
maven
、
applicationcontext
我在我的applicationContext文件中添加了以下内容 </list> </bean> 我需
浏览 1
提问于2016-05-05
得票数 1
回答已采纳
2
回答
Spring
:从文件系统加载特定于application.properties的配置文件
spring
、
spring-boot
、
properties-file
我试图根据当前的活动配置文件加载外部
属性
文件。以及我定义的
属性
文件如下:qa -> c:\external-configurationconfig\application-qa.properties如何将
spring
我试图将
Proper
浏览 1
提问于2018-09-18
得票数 0
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
Spring——体系结构
Spring源码阅读
聊聊Spring的XML Schema扩展机制的使用方式
Spring源码系列:依赖注入(三)-属性注入
学会反射后,我被录取了(干货)
热门
标签
更多标签
云服务器
即时通信 IM
ICP备案
对象存储
实时音视频
活动推荐
运营活动
广告
关闭
领券