【发布时间】:2014-08-19 09:29:50
【问题描述】:
版本:
Aapche MyFaces 2.1.14
RichFaces 4.3.5
问题:
我面临着非常奇怪的标签问题。
如下代码所示,第一次渲染from时,应该调用bean.getPassword方法。
但似乎在第一次呈现表单时(在进行回发之前)没有调用此方法。我已经通过调试验证了它。
奇怪的是,如果我把h:inputSecret 的EL 放在页面的其他地方,这个方法确实会被调用
我真的被卡住了,为什么会这样? 有没有人遇到过这样的问题?
代码:
<h:form prependId="false">
<!-- check whether getter is called , it gets called in this case -->
#{bean.password}
<h:panelGrid columns="2">
<h:outputText value="User ID:"/>
<h:inputText value="#{bean.userId}"/>
<h:outputText value="Password:"/>
<h:inputSecret id="passwd1" name="passwd1" required="true" value="#{bean.password}"
requiredMessage="Password is required"/>
<h:panelGrid>
</h:form>
【问题讨论】: