【问题标题】:hybris WCMS renderer pass attributeshybris WCMS 渲染器传递属性
【发布时间】:2015-03-04 16:01:04
【问题描述】:

我正在通过 addOn 扩展实现几个 CMS 组件,然后将它们添加到店面。我使用的是渲染器而不是控制器,并且我能够将我的项目的属性传递给 jsp 文件。但是,我有一个问题,这可能很简单,但我被卡住了。假设我想通过渲染器将当前用户 ID 传递给我的 JSP。这可能吗?

  protected Map<String, Object> getVariablesToExpose(final PageContext pageContext, final C component)
{
    final Map<String, Object> variables = new HashMap<String, Object>();
    for (final String property : cmsComponentService.getEditorProperties(component))
    {
        try
        {
            final Object value = modelService.getAttributeValue(component, property);
            variables.put(property, value);

        }
        catch (final AttributeNotSupportedException ignore)
        {
            // ignore
        }
    }
    return variables;
}

这是我的代码,用于获取我的项目类型及其值的属性。但我不想在我的 CMS 组件中有额外的名为 user id 的字段。

【问题讨论】:

    标签: java spring hybris


    【解决方案1】:

    尝试做类似的事情

    if (property == "uid")
    {
        continue;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-12-30
      • 1970-01-01
      • 2020-12-05
      • 2011-09-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多