/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package pacote;
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
/**
*
* @author cristian.urbainski
*/
@ManagedBean
public class PessoaAux {
private List<Pessoa> lista = new ArrayList<Pessoa>();
public List<Pessoa> getLista() {
return lista;
}
public void setLista(List<Pessoa> lista) {
this.lista = lista;
}
public void addPessoa(Pessoa p)
{
this.lista.add(p);
}
}
package pacote;
import javax.faces.bean.ManagedBean;
/**
* @author cristian.urbainski
*/
@ManagedBean
public class TesteBean {
private String texto;
public TesteBean()
{
this.texto = "Cristian";
}
public String getTexto() {
return texto;
}
public void setTexto(String texto) {
this.texto = texto;
}
public void transformaCaixaAlta()
{
this.texto = this.texto.toUpperCase();
}
}
<?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>
<title>Facelet Title</title>
</h:head>
<h:body>
<h:form>
<h:outputLabel value="Cadastro de Pessoas"/>
<br/>
<h:panelGrid columns="2">
<h:outputLabel value="Nome : " for="txtNome"/>
<h:inputText id="txtNome" value="#{pessoa.nome}"/>
<h:outputLabel value="Idade : " for="txtIdade"/>
<h:inputText id="txtIdade" maxlength="2" value="#{pessoa.idade}" />
<h:outputLabel value="Endereço : " for="txtRua"/>
<h:inputText value="#{pessoa.rua}" id="txtRua" />
<h:commandButton value="Adicionar Pessoa" action="#{pessoaAux.addPessoa(pessoa)}"/>
</h:panelGrid>
</h:form>
<h:dataTable value="#{pessoa.lista}" var="pessoa" border="1" cellspacing="0" width="350" >
<f:facet name="header">Lista de Pessoas</f:facet>
<h:column>
<f:facet name="header">Nome</f:facet>
#{pessoa.nome}
</h:column>
<h:column>
<f:facet name="header">Idade</f:facet>
#{pessoa.idade}
</h:column>
<h:column>
<f:facet name="header">Endereço</f:facet>
#{pessoa.rua}
</h:column>
</h:dataTable>
</h:body>
</html>
quanto executei obtive o seguinte erro
/index.xhtml @21,100 action="#{pessoaAux.addPessoa(pessoa)}" Error Parsing: #{pessoaAux.addPessoa(pessoa)}
como resolver isso:

