-
Sep 22nd, 2008, 08:48 PM
#1
wildcards in resource locations?
Hi,
I have declared a messageSource bean as follows (note: the resource bundles are *outside* my webapp's classpath and need to stay that way):
<bean id="messageSource" class="org.springframework.context.support.Reloada bleResourceBundleMessageSource">
<property name="basenames">
<list>
<value>foo/bar-1/BaseName</value>
<value>foo/bar-2/BaseName</value>
<value>foo/bar-3/BaseName</value>
<value>foo/bar-4/BaseName</value>
</list>
</property>
</bean>
The above is working fine. However, if possible, I would prefer to trim this configuration down with a wildcard in the path, as follows:
<bean id="messageSource" class="org.springframework.context.support.Reloada bleResourceBundleMessageSource">
<property name="basenames">
<list>
<value>foo/bar-*/BaseName</value>
</list>
</property>
</bean>
Or even:
<bean id="messageSource" class="org.springframework.context.support.Reloada bleResourceBundleMessageSource">
<property name="basenames">
<list>
<value>foo/**/BaseName</value>
</list>
</property>
</bean>
I've tried both of these wildcard configurations (and some other alternatives) but I don't seem to using the correct syntax, since the bundles are never resolved. Could someone please clue me in on the correct syntax? Note: I've tried prefixing the file protocol ("file:", "file:/", "file://", even "file:///") but that didn't do the trick...
Thanks!
-
Sep 23rd, 2008, 02:19 AM
#2
ReloadableResourceBundleMessageSource doesn't offer ability you mentioned out of the box. However, it's open-sourced, so, you can wrap it a little in order to scan resource files via standard spring resource resolution.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules