public class TestResource {
public static void main(String[] args) { ResourceLoader resourceLoader = new DefaultResourceLoader(); ReloadableResourceBundleMessageSource auto = new ReloadableResourceBundleMessageSource(); String[] basenames = {"filename"}; auto.setBasenames(basenames); auto.setResourceLoader(resourceLoader); auto.setCacheSeconds(5); auto.setUseCodeAsDefaultMessage(true); while(true) { System.out.println(auto.getMessage("key", null, Locale.CHINESE)); try { Thread.sleep(5*1000); } catch (InterruptedException e) { e.printStackTrace(); } }}
}