java - Does Spring MessageSource Support Multiple Class Path? -
i designing plugin system our web based application using spring framework. plugins jars on classpath. able sources such jsp, see below
resourcepatternresolver resolver = new pathmatchingresourcepatternresolver(); resource[] pages = resolver.getresources("classpath*:jsp/*jsp");
so far good. have problem messagesource. seems me reloadableresourcebundlemessagesource#setbasename not support multiple class path via "classpath*:" if use "classpath:", messagesource 1 plugin.
does have idea how register messagesources plugins? exist such implementation of messagesource?
the issue here not multiple classpaths or classloaders, how many resources code try , load given path.
the classpath*
syntax spring mechanism, 1 allows code load multiple resources given path. handy. however, resourcebundlemessagesource
uses standard java.util.resourcebundle
load resources, , simpler, dumber mechanism, load first resource given path, , ignore else.
i don't have easy fix you. think you're going have ditch resourcebundlemessagesource
, write custom implementation of messagesource
(most subclassing abstractmessagesource
) uses pathmatchingresourcepatternresolver
locate various resources , expose them via messagesource
interface. resourcebundle
isn't going help.
Comments
Post a Comment