本文整理汇总了Java中org.springframework.context.support.MessageSourceResourceBundle类的典型用法代码示例。如果您正苦于以下问题:Java MessageSourceResourceBundle类的具体用法?Java MessageSourceResourceBundle怎么用?Java MessageSourceResourceBundle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MessageSourceResourceBundle类属于org.springframework.context.support包,在下文中一共展示了MessageSourceResourceBundle类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: exposeLocalizationContext
import org.springframework.context.support.MessageSourceResourceBundle; //导入依赖的package包/类
/**
* Expose current Spring-managed Locale and MessageSource to JasperReports i18n
* ($R expressions etc). The MessageSource should only be exposed as JasperReports
* resource bundle if no such bundle is defined in the report itself.
* <p>The default implementation exposes the Spring RequestContext Locale and a
* MessageSourceResourceBundle adapter for the Spring ApplicationContext,
* analogous to the {@code JstlUtils.exposeLocalizationContext} method.
* @see org.springframework.web.servlet.support.RequestContextUtils#getLocale
* @see org.springframework.context.support.MessageSourceResourceBundle
* @see #getApplicationContext()
* @see net.sf.jasperreports.engine.JRParameter#REPORT_LOCALE
* @see net.sf.jasperreports.engine.JRParameter#REPORT_RESOURCE_BUNDLE
* @see org.springframework.web.servlet.support.JstlUtils#exposeLocalizationContext
*/
protected void exposeLocalizationContext(Map<String, Object> model, HttpServletRequest request) {
RequestContext rc = new RequestContext(request, getServletContext());
Locale locale = rc.getLocale();
if (!model.containsKey(JRParameter.REPORT_LOCALE)) {
model.put(JRParameter.REPORT_LOCALE, locale);
}
TimeZone timeZone = rc.getTimeZone();
if (timeZone != null && !model.containsKey(JRParameter.REPORT_TIME_ZONE)) {
model.put(JRParameter.REPORT_TIME_ZONE, timeZone);
}
JasperReport report = getReport();
if ((report == null || report.getResourceBundle() == null) &&
!model.containsKey(JRParameter.REPORT_RESOURCE_BUNDLE)) {
model.put(JRParameter.REPORT_RESOURCE_BUNDLE,
new MessageSourceResourceBundle(rc.getMessageSource(), locale));
}
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:32,代码来源:AbstractJasperReportsView.java
示例2: getResourceBundle
import org.springframework.context.support.MessageSourceResourceBundle; //导入依赖的package包/类
@Override
public ResourceBundle getResourceBundle() {
HttpSession session = this.request.getSession(false);
if (session != null) {
Object lcObject = Config.get(session, Config.FMT_LOCALIZATION_CONTEXT);
if (lcObject instanceof LocalizationContext) {
ResourceBundle lcBundle = ((LocalizationContext) lcObject).getResourceBundle();
return new MessageSourceResourceBundle(this.messageSource, getLocale(), lcBundle);
}
}
return new MessageSourceResourceBundle(this.messageSource, getLocale());
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:13,代码来源:JstlUtils.java
示例3: postHandle
import org.springframework.context.support.MessageSourceResourceBundle; //导入依赖的package包/类
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
ModelAndView modelAndView) throws Exception
{
if (modelAndView != null)
{
modelAndView.addObject(KEY_RESOURCE_FINGERPRINT_REGISTRY, resourceFingerprintRegistry);
modelAndView.addObject(KEY_THEME_FINGERPRINT_REGISTRY, themeFingerprintRegistry);
modelAndView.addObject(KEY_APP_SETTINGS, appSettings);
modelAndView.addObject(KEY_AUTHENTICATION_SETTINGS, authenticationSettings);
modelAndView.addObject(KEY_ENVIRONMENT, getEnvironmentAttributes());
modelAndView.addObject(KEY_I18N,
new MessageSourceResourceBundle(messageSource, LocaleContextHolder.getLocale()));
}
}
开发者ID:molgenis,项目名称:molgenis,代码行数:16,代码来源:MolgenisInterceptor.java
示例4: getResourceBundle
import org.springframework.context.support.MessageSourceResourceBundle; //导入依赖的package包/类
@Override
public ResourceBundle getResourceBundle(Locale locale) {
return new MessageSourceResourceBundle(this.messageSource, locale);
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:MessageSourceResourceBundleLocator.java
示例5: fxmlComponentResourceBundle
import org.springframework.context.support.MessageSourceResourceBundle; //导入依赖的package包/类
@Bean
public ResourceBundle fxmlComponentResourceBundle(MessageSource messageSource) {
return new MessageSourceResourceBundle(messageSource, LocaleContextHolder.getLocale());
}
开发者ID:schulzp,项目名称:spring-javafx,代码行数:5,代码来源:FXMLComponentConfiguration.java
示例6: getResourceBundle
import org.springframework.context.support.MessageSourceResourceBundle; //导入依赖的package包/类
public ResourceBundle getResourceBundle(Locale locale) {
return new MessageSourceResourceBundle(this.messageSource, locale);
}
开发者ID:deathspeeder,项目名称:class-guard,代码行数:4,代码来源:MessageSourceResourceBundleLocator.java
示例7: getBundle
import org.springframework.context.support.MessageSourceResourceBundle; //导入依赖的package包/类
/**
* Creates a localization ResourceBundle for current locale.
*
* @return MessageSourceResourceBundle
*/
@Deprecated
public static MessageSourceResourceBundle getBundle()
{
return new MessageSourceResourceBundle(getMessageSource(), getLocale());
}
开发者ID:molgenis,项目名称:molgenis,代码行数:11,代码来源:LanguageService.java
示例8: exposeLocalizationContext
import org.springframework.context.support.MessageSourceResourceBundle; //导入依赖的package包/类
/**
* Expose current Spring-managed Locale and MessageSource to JasperReports i18n
* ($R expressions etc). The MessageSource should only be exposed as JasperReports
* resource bundle if no such bundle is defined in the report itself.
* <p>The default implementation exposes the Spring RequestContext Locale and a
* MessageSourceResourceBundle adapter for the Spring ApplicationContext,
* analogous to the {@code JstlUtils.exposeLocalizationContext} method.
* @see org.springframework.web.servlet.support.RequestContextUtils#getLocale
* @see org.springframework.context.support.MessageSourceResourceBundle
* @see #getApplicationContext()
* @see net.sf.jasperreports.engine.JRParameter#REPORT_LOCALE
* @see net.sf.jasperreports.engine.JRParameter#REPORT_RESOURCE_BUNDLE
* @see org.springframework.web.servlet.support.JstlUtils#exposeLocalizationContext
*/
protected void exposeLocalizationContext(Map<String, Object> model, HttpServletRequest request) {
RequestContext rc = new RequestContext(request, getServletContext());
if (!model.containsKey(JRParameter.REPORT_LOCALE)) {
model.put(JRParameter.REPORT_LOCALE, rc.getLocale());
}
JasperReport report = getReport();
if ((report == null || report.getResourceBundle() == null) &&
!model.containsKey(JRParameter.REPORT_RESOURCE_BUNDLE)) {
model.put(JRParameter.REPORT_RESOURCE_BUNDLE,
new MessageSourceResourceBundle(rc.getMessageSource(), rc.getLocale()));
}
}
开发者ID:deathspeeder,项目名称:class-guard,代码行数:27,代码来源:AbstractJasperReportsView.java
注:本文中的org.springframework.context.support.MessageSourceResourceBundle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论