PrimeFaces验证页面:错误:HTTP状态500 - 错误解析/event.xhtml:

时间:2015-01-21 05:07:24

标签: primefaces

错误:

  

跟踪错误[第16行]前缀" f"对于元素   " F:validateLength"不受约束。

event.xhtml

<h:form>
<p:panel header="Validate">
    <h:panelGrid columns="4" cellpadding="5">
        <h:outputLabel for="text" value="Text: (Change)" />
        <p:inputText id="text" value="#{validationView.text}" required="true">
            <f:validateLength minimum="2" maximum="5" />
            <p:clientValidator />
        </p:inputText>
        <p:message for="text" display="icon" />
        <h:outputText value="#{validationView.text}" />

        <h:outputLabel for="integer" value="Integer: (Keyup)" />
        <p:inputText id="integer" value="#{validationView.integer}">
            <p:clientValidator event="keyup"/>
        </p:inputText>
        <p:message for="integer" display="icon" />
        <h:outputText value="#{validationView.integer}" />
    </h:panelGrid>

    <p:commandButton value="Save" ajax="false" icon="ui-icon-check" validateClient="true" />
</p:panel>

ValidationView.java

package testcase;

import javax.faces.bean.ManagedBean;

@ManagedBean
public class ValidationView {

    private String text;
    private Integer integer;

    public String getText() {
        return text;
    }
    public void setText(String text) {
        this.text = text;
    }

    public Integer getInteger() {
        return integer;
    }
    public void setInteger(Integer integer) {
        this.integer = integer;
    }
}

0 个答案:

没有答案