2
當鼠標懸停時,我得到兩個驗證消息,一個正確,然後一個在窗體的頂部,表示項目階段[開發]:未處理消息,我怎麼能隱藏這條消息?項目階段[開發]:未處理的消息 - JSF
<h:outputLabel for="username">Please enter your username: </h:outputLabel>
<h:inputText id="username" value="#{user.id}" required="true">
<f:ajax event="blur" render="usernameMessage" />
</h:inputText>
<h:message id="usernameMessage" for="username" />
userBean.java
private static final long serialVersionUID = 1L;
@NotNull (message = "The username can not be blank")
@Size(min = 6, max=12, message = "Please enter a valid username (6-12 characters)")
private String id;
public String getId() {
return id;
}
的web.xml
<context-param>
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
<param-value>true</param-value>
</context-param>