JSF 2.0 command button 为‘null Converter’设置值“……“时发生转换错误。

为 commandButton标签添加 immediate=”true”属性能够解决以上问题

添加前

<h:commandButton value="your value" action="#{bean.action}"/>

添加后

<h:commandButton value="your value"  immediate="true" action="#{bean.action}"/>

immediate属性介绍:

Flag indicating that, if this component is activated by the user, notifications should be delivered to interested listeners and actions immediately (that is, during Apply Request Values phase) rather than waiting until Invoke Application phase.

标志表明,如果这个组件被用户激活,那么应该立即(即,在“申请请求值”阶段期间)将通知递送到感兴趣的***和动作,而不是等到“调用应用程序”阶段。