`
kong6001
  • 浏览: 141279 次
  • 性别: Icon_minigender_1
  • 来自: 广东广州
社区版块
存档分类
最新评论

Spring propertyConfigurer使用

阅读更多
配置Bean
  1.  <bean id="propertyConfigurer"  
  2. class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"  lazy-init="false">  
  3. <property name="locations">  
  4. <list>  
  5. <value>/WEB-INF/jdbc.properties</value>  
  6. </list>  
  7. </property>  
  8. </bean>  

 

引用
  1. <property name="username" value="${jdbc.username}" />  
  2. <property name="password" value="${jdbc.password}" />  
分享到:
评论
2 楼 xbcoil 2010-04-03  
不存在把....你没有建立jdbc.porperties...
1 楼 sclsch 2008-10-28  
<value>/WEB-INF/jdbc.properties</value> 
为什么报
java.io.FileNotFoundException: WEB-INF\jdbc.properties (系统找不到指定的路径。)

相关推荐

    Spring PropertyPlaceholderConfigurer配置文件加载器集成ZooKeeper来实现远程配置读取

    以上就是关于"Spring PropertyPlaceholderConfigurer配置文件加载器集成ZooKeeper来实现远程配置读取"的详细解释,涵盖了Spring的配置处理、ZooKeeper的使用以及两者结合的实现过程。理解并掌握这一技术,有助于提升...

    spring2.5 配置VM

    &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt; &lt;value&gt;classpath:db.properties ${jdbc.driver}" /&gt; ${jdbc.url}" /&gt; ${jdbc....

    Spring MVC 入门实例

    6 &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt; 7 8 9 &lt;value&gt;/WEB-INF/jdbc.properties 10 11 12 13 14 它配置了以下功能: 读取...

    关于spring系统中多系统的配置

    通过这种方式,我们可以轻松地在Spring配置文件中使用占位符语法`${property.name}`来引用`dbQuery.properties`中的属性。 ### 配置多个Properties文件 当需要引用多个属性文件时,可以使用`locations`属性代替`...

    Spring中PropertyPlaceholderConfigurer的使用

    Spring 中 PropertyPlaceholderConfigurer 的使用 PropertyPlaceholderConfigurer 是 Spring 框架中的一个重要组件,用于加载和管理 Properties 文件。它能够将 Properties 文件中的键值对注入到 Spring 的 bean 中...

    Spring 容器后处理器

    &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt; &lt;value&gt;classpath:application.properties ``` 在这个示例中,`...

    spring 配置文件 归类

    &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt; &lt;value&gt;classpath:database.properties &lt;bean id="dataSource" class="org.spring...

    配置spring

    &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt; &lt;value&gt;/WEB-INF/conf/jdbc.properties &lt;!-- Define the DataSource bean --&gt; ...

    Spring数据库连接等配置加密

    `propertyConfigurer`则告诉Spring使用解密器来处理配置文件中的加密属性。 最后,关于`junfeng`这个文件,它可能是作者在文章中提到的一种特定的加密方式或者一个工具的名称。由于没有具体的文件内容,这里无法给...

    Spring 3.0 整合Ibatis 3

    &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt; &lt;value&gt;/com/citipf/liyunpeng/mainConfig.properties&lt;/value&gt; &lt;!-- C3P0 连接池配置...

    SPRING:bean配置properties

    当存在多个配置文件时,可以使用`locations`属性代替`location`,以列表形式指定多个文件路径。例如: ```xml &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config....

    spring读取properties

    &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt; &lt;value&gt;/db.properties ``` 这里,`locations`属性指定了要加载的Properties文件的...

    Spring项目中怎么配置log4j

    &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt; ``` 这使得Spring在启动时会自动加载`log4j.properties`,而无需在Java代码中进行任何特殊...

    org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

    `spring1.docx`和`spring2.docx`可能是两份关于Spring框架的文档,可能包含了更多关于`PropertyPlaceholderConfigurer`的使用示例、最佳实践以及与其他Spring特性(如`@Value`注解、`@ConfigurationProperties`等)...

    Spring属性占位符PropertyPlaceholderConfigurer的使用

    &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt; ``` 在上面的代码中,`location`属性指定了属性文件的位置,这里我们假设有一个名为`config....

    struts2 hibernate spring集成

    在现代软件开发过程中,特别是Java Web应用开发领域,Struts2、Hibernate与Spring三者的集成使用非常常见。这种集成不仅可以提高应用程序的可维护性和扩展性,还能极大地简化开发流程。接下来将详细介绍如何在...

    spring对多个数据库进行事务管理.doc

    &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt; &lt;value&gt;classpath:database.properties ``` 总之,Spring通过灵活的配置和强大的AOP...

    Spring+Webwork+iBatis 组合实例

    &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt; &lt;value&gt;WEB-INF/jdbc.properties ``` 这部分配置创建了一个`...

    Spring 自定义注解注入properties文件的值jar包

    Spring 自定义注解注入properties文件的值jar包,下面为使用方法 在xml配置文件中,这样加载properties文件 &lt;bean id="propertyConfigurer" class=...

    Spring3.0 配置文件中加载Properties文件的小例子

    本篇将详细讲解如何在Spring 3.0的配置文件中加载Properties文件,以便在运行时动态获取和使用这些配置。 首先,我们需要一个Properties文件,例如`application.properties`,它通常放在项目的类路径根目录下。这个...

Global site tag (gtag.js) - Google Analytics