本文整理汇总了Java中org.apache.sling.api.SlingHttpServletRequest.getResourceBundle方法的典型用法代码示例。如果您正苦于以下问题:Java SlingHttpServletRequest.getResourceBundle方法的具体用法?Java SlingHttpServletRequest.getResourceBundle怎么用?Java SlingHttpServletRequest.getResourceBundle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.sling.api.SlingHttpServletRequest
的用法示例。
在下文中一共展示了SlingHttpServletRequest.getResourceBundle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doGet
import org.apache.sling.api.SlingHttpServletRequest; //导入方法依赖的package包/类
@Override
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
throws ServletException, IOException {
SlingBindings bindings = (SlingBindings) request.getAttribute(SlingBindings.class.getName());
Page currentPage = (Page) bindings.get(WCMBindings.CURRENT_PAGE);
final Locale pageLocale = currentPage.getLanguage(true);
final ResourceBundle bundle = request.getResourceBundle(pageLocale);
i18n = new I18n(bundle);
SimpleDataSource countriesDataSource = new SimpleDataSource(buildCountriesList(request.getResourceResolver()).iterator());
request.setAttribute(DataSource.class.getName(), countriesDataSource);
}
开发者ID:Adobe-Marketing-Cloud,项目名称:aem-sample-we-retail,代码行数:12,代码来源:CountriesFormOptionsDataSource.java