messagesource读取properties

xml中配置:


		
			
				classpath:web
			
		
	

程序中注入:

@Resource
	private MessageSource messageSource;

获取:

String username = messageSource.getMessage("username", new Object[]{}, LocaleContextHolder.getLocale());


你可能感兴趣的:(#,java)