首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

Spring 三.0--Composing XML-based configuration metadata

2013-11-22 
Spring 3.0--Composing XML-based configuration metadatabeansimport resourceservices.xml/impo

Spring 3.0--Composing XML-based configuration metadata

<beans><import resource="services.xml"/><import resource="resources/messageSource.xml"/><import resource="/resources/themeSource.xml"/><bean id="bean1" path. Doing so creates a dependency on a file that is outside the current application. Inparticular, this reference is not recommended for "classpath:" URLs (for example,"classpath:../services.xml"), where the runtime resolution process chooses the "nearest"classpath root and then looks into its parent directory. Classpath configuration changes maylead to the choice of a different, incorrect directory.
  You can always use fully qualified resource locations instead of relative paths: for example,"file:C:/config/services.xml" or "classpath:/config/services.xml". However, be aware that you are coupling your application's configuration to specific absolute locations. It is generally preferable to keep an indirection for such absolute locations, for example, through "${...}" placeholders that are resolved against JVM system properties at runtime.

?

热点排行