首页 文章

在客户端操作禁用的属性;如果组件被禁用,JSF会正确测试吗?

提问于
浏览
1

Primefaces 3.5.10,Mojarra 2.1.21,Omnifaces 1.5

我正在考虑安全问题 .

我使用component.getAttributes()方法设置了component属性 . 此方法返回带有属性的HashMap . 在此映射中设置(“disabled”,true) - pair以禁用组件(例如p:inputText-component)是否安全?我在jsf管道的actionListener(阶段5或4)中使用它 . 所以它可能仅对渲染阶段有影响 . 但是我可以在客户端上从输入法操作disabled属性,然后发布被操纵的值 . 如果组件被禁用,服务器是否进行测试并拒绝更改?

什么是最好的方式?

panelGrid中的所有组件都将被禁用:

xhtml:
<p:panelGrid>
  <my:component/>
  <p:input value=#{mybean.value} />
</p:panelGrid>

Bean:

for (UIComponent component : l) {
  component.getAttributes().put("disabled", true);

  recursion(....);
}

1 回答

相关问题