0
我有xml。 (Ehcache.xml) 我想從屬性文件(在類路徑上)注入屬性。將屬性注入非託管Spring xml
但是由於這個xml不是Spring託管bean,我無法這樣做。
任何建議如何克服這一點?
的XML:
...
properties="peerDiscovery=manual,rmiUrls=//**${other.node.hostname}**:41001/org.jasig.cas.ticket.ServiceTicket|//**${other.node.hostname}**:41001/org.jasig.cas.ticket.TicketGrantingTicket"
propertySeparator="," />
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="port=41001,socketTimeoutMillis=5000" />
</ehcache>
我要注入$ {} other.node.hostname從另一個屬性文件。
,但我得到這個運行時:java.net.URISyntaxException:非法字符在當局在指數2:
所致// $ {} other.node.hostname:41001/org.jasig .cas.ticket.TicketGrantingTicket
謝謝, ray。
但是,你將如何修改具有以下屬性的新的spring xml:cacheManagerPeerProviderFactory,cacheManagerPeerListenerFactory? – rayman