【发布时间】: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 的字段。
【问题讨论】: