读书人

Spring 三.0--Composing XML-based

发布时间: 2013-11-22 23:06:19 作者: rapoo

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.

?

读书人网 >操作系统

热点推荐