Boa noite, não sei o q está errado, meu código estava rodando, ai fiz os últimos exerc. e apresenta esse erro:
GRAVE: Servlet.service() for servlet [Faces Servlet] in context with path [/livraria] threw exception [/livro.xhtml @26,50 <f:ajax> 'Keypress' is not a supported event for HtmlInputText. Please specify one of these supported event names: blur, change, click, dblclick, focus, keydown, keypress, keyup, mousedown, mousemove, mouseout, mouseover, mouseup, select, valueChange.] with root cause
javax.faces.view.facelets.TagException: /livro.xhtml @26,50 <f:ajax> 'Keypress' is not a supported event for HtmlInputText. Please specify one of these supported event names: blur, change, click, dblclick, focus, keydown, keypress, keyup, mousedown, mousemove, mouseout, mouseover, mouseup, select, valueChange.
at com.sun.faces.facelets.tag.jsf.core.AjaxHandler.applyAttachedObject(AjaxHandler.java:324)
Segue meu cód livro.xhtml:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head />
<h:body>
<h1>Novo Livro</h1>
<h:form>
<h:messages id="messages" />
<fieldset>
<legend>Dados do Livro</legend>
<h:panelGrid columns="2">
<h:outputLabel value="Titulo:" for="titulo" />
<h:inputText id="titulo" value="#{livroBean.livro.titulo}"
required="true" requiredMessage="Título obrigtório"
validatorMessage="Título não pode ser superior a 40 caracteres">
<f:validateLength maximum="40" />
<f:ajax event="blur" render="messages" />
</h:inputText>
<h:outputLabel value="ISBN:" for="isbn" />
<h:inputText id="isbn" value="#{livroBean.livro.isbn}"
validator="#{livroBean.comecaComDigitoUm}">
<f:ajax event="Keypress" render="messages"/>
</h:inputText>
<h:outputLabel value="Preço:" for="preco" />
<h:inputText id="preco" value="#{livroBean.livro.preco}"
label="Preço">
<f:validateDoubleRange minimum="1.0" maximum="1000.00" />
</h:inputText>
<h:outputLabel value="Data de Lançamento:" for="dataLancamento" />
<h:inputText id="dataLancamento"
value="#{livroBean.livro.dataLancamento.time}">
<f:convertDateTime pattern="dd/MM/yyyy"
timeZone="America/Sao_Paulo" />
</h:inputText>
</h:panelGrid>
</fieldset>
<fieldset>
<legend>Dados do Autor</legend>
<h:outputLabel value="Selecione Autor:" for="autor" />
<h:selectOneMenu value="#{livroBean.autorId}" id="autor">
<f:selectItems value="#{livroBean.autores}" var="autor"
itemLabel="#{autor.nome}" itemValue="#{autor.id}" />
</h:selectOneMenu>
<h:commandButton value="Gravar Autor"
action="#{livroBean.gravarAutor}">
<f:ajax execute="autor" render="tabelaAutores" />
</h:commandButton>
<h:dataTable value="#{livroBean.autoresDoLivro}" var="autor"
id="tabelaAutores">
<h:column>
<h:outputText value="#{autor.nome}" />
</h:column>
</h:dataTable>
</fieldset>
<h:commandButton value="Gravar" action="#{livroBean.gravar}">
<f:ajax execute="@form" render="@form :tabelaLivros" />
</h:commandButton>
</h:form>
<h:dataTable value="#{livroBean.livros}" var="livro" id="tabelaLivros">
<h:column>
<f:facet name="header">Título</f:facet>
<h:outputText value="#{livro.titulo}" />
</h:column>
<h:column>
<f:facet name="header">ISBN</f:facet>
<h:outputText value="#{libro.isbn}" />
</h:column>
<h:column>
<f:facet name="header">Preco</f:facet>
<h:outputText value="#{livro.preco}">
<f:convertNumber type="currency" pattern="R$ 0.00 "
currencySymbol="R$" locale="pt_BR" />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">Data</f:facet>
<h:outputText value="#{livro.datalancamento.time}">
<f:convertDateTime timeZone="America/Sao_Paulo" pattern="dd/MM/yyyy"></f:convertDateTime>
</h:outputText>
</h:column>
</h:dataTable>
</h:body>
</html>