本文整理匯總了Java中org.springframework.context.support.ResourceBundleMessageSource.setUseCodeAsDefaultMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java ResourceBundleMessageSource.setUseCodeAsDefaultMessage方法的具體用法?Java ResourceBundleMessageSource.setUseCodeAsDefaultMessage怎麽用?Java ResourceBundleMessageSource.setUseCodeAsDefaultMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.context.support.ResourceBundleMessageSource
的用法示例。
在下文中一共展示了ResourceBundleMessageSource.setUseCodeAsDefaultMessage方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: defaultMessageSource
import org.springframework.context.support.ResourceBundleMessageSource; //導入方法依賴的package包/類
@Bean
public MessageSource defaultMessageSource() {
ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
messageSource.setBasenames("messages", "i18n/messages");
messageSource.setDefaultEncoding(Charset.forName("UTF-8").name());
messageSource.setFallbackToSystemLocale(true);
messageSource.setCacheSeconds(-1);
messageSource.setAlwaysUseMessageFormat(false);
messageSource.setUseCodeAsDefaultMessage(true);
return messageSource;
}
示例2: messageSource
import org.springframework.context.support.ResourceBundleMessageSource; //導入方法依賴的package包/類
@Bean
public MessageSource messageSource() {
ResourceBundleMessageSource msgsource = new ResourceBundleMessageSource();
if (nixmashModeEnabled)
msgsource.setBasename("nixmash");
else
msgsource.setBasename("messages");
msgsource.setUseCodeAsDefaultMessage(
Boolean.parseBoolean(environment.getRequiredProperty(USE_CODE_AS_DEFAULT_MESSAGE)));
return msgsource;
}
示例3: messageSource
import org.springframework.context.support.ResourceBundleMessageSource; //導入方法依賴的package包/類
@Bean
public ResourceBundleMessageSource messageSource() {
ResourceBundleMessageSource source = new ResourceBundleMessageSource();
source.setBasenames("i18n/messages");
source.setUseCodeAsDefaultMessage(true);
source.setDefaultEncoding("UTF-8");
return source;
}
示例4: messageSource
import org.springframework.context.support.ResourceBundleMessageSource; //導入方法依賴的package包/類
@Bean
public ResourceBundleMessageSource messageSource() {
ResourceBundleMessageSource bundleMessageSource = new ResourceBundleMessageSource();
bundleMessageSource.setUseCodeAsDefaultMessage(true);
bundleMessageSource.setBasenames(i18nMessages.split(","));
return bundleMessageSource;
}
示例5: messageSource
import org.springframework.context.support.ResourceBundleMessageSource; //導入方法依賴的package包/類
@Bean
public ResourceBundleMessageSource messageSource() {
ResourceBundleMessageSource source = new ResourceBundleMessageSource();
source.setBasenames("i18n/message");
source.setUseCodeAsDefaultMessage(true);
return source;
}
示例6: messageSource
import org.springframework.context.support.ResourceBundleMessageSource; //導入方法依賴的package包/類
@Bean
public MessageSource messageSource() {
ResourceBundleMessageSource source = new ResourceBundleMessageSource();
source.setBasename("i18n/messages");
source.setUseCodeAsDefaultMessage(true);
return source;
}
示例7: createMessageSource
import org.springframework.context.support.ResourceBundleMessageSource; //導入方法依賴的package包/類
/**
* 文言定義を生成する。
*
* @return 文言定義。
*/
private MessageSource createMessageSource() {
ResourceBundleMessageSource msgSrc = new ResourceBundleMessageSource();
msgSrc.setBasenames("message/launcher", "message/batchId");
msgSrc.setUseCodeAsDefaultMessage(true);
return msgSrc;
}
示例8: messageSource
import org.springframework.context.support.ResourceBundleMessageSource; //導入方法依賴的package包/類
@Bean
public ResourceBundleMessageSource messageSource() {
ResourceBundleMessageSource source = new ResourceBundleMessageSource();
source.setBasename(env.getRequiredProperty("message.source.basename"));
source.setUseCodeAsDefaultMessage(true);
return source;
}
示例9: prepareMessageSource
import org.springframework.context.support.ResourceBundleMessageSource; //導入方法依賴的package包/類
private void prepareMessageSource() {
messageSource = new ResourceBundleMessageSource();
messageSource.setBasename("messages/messages");
messageSource.setUseCodeAsDefaultMessage(true);
}
示例10: SpringBundle
import org.springframework.context.support.ResourceBundleMessageSource; //導入方法依賴的package包/類
protected SpringBundle(String... baseNames) {
source = new ResourceBundleMessageSource();
source.setFallbackToSystemLocale(false);
source.setBasenames(baseNames);
source.setUseCodeAsDefaultMessage(true);
}