JSF: problemas com date
29/10/2011
0
Estou com um problema no JSF.
SEGUE O ERRO
GRAVE: Error Rendering View[/usuario.xhtml]
javax.el.PropertyNotFoundException: /usuario.xhtml @23,46 value=#{usuarioBean.usuario.nascimento}: Property nascimento not found on type financeiro.usuario.Usuario
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:111)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:193)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:181)
at javax.faces.component.UIOutput.getValue(UIOutput.java:169)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:355)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:883)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:312)
at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185)
at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:853)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:853)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:399)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:509)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at financeiro.web.filter.ConexaoHibernateFilter.doFilter(ConexaoHibernateFilter.java:33)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:304)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
pelo o que eu entendi o erro esta na propriedade nascimento da pagina não e do mesmo tipo do objeto Usuario, so que eu revisei e esta tudo ok!
Segue a baixo a classe e a pagina
-------------------------------------------------------------------
classe
@Entity
public class Usuario implements Serializable {
@Id
@GeneratedValue
private Integer codigo;
private String nome;
private String email;
@org.hibernate.annotations.NaturalId
private String login;
private String senha;
private Date nascimento;
private String celular;
private String idioma;
private boolean ativo;
public Usuario(){
}
//gets e sets
------------------------------------------------------------
pagina
.
.
.
.
<h:form id=cadastro>
</h:inputText>
<h:outputLabel value=Data Nascimento for=data/>
<h:inputText id=data label=Data Nascimento value=#{usuarioBean.usuario.nascimento}
size=10 maxlength=10 required=true>
<f:convertDateTime dateStyle=medium/>
</h:inputText>
</h:form>
.
.
.
Ismael Oliveira
Posts
29/10/2011
Davi Costa
Dá um clean e um refresh no seu projeto e no seu servidor.
Att Davi
30/10/2011
Ismael Oliveira
/**
*
*/
package financeiro.web;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;
import financeiro.usuario.Usuario;
import financeiro.usuario.UsuarioRN;
/**
* @author Ismael
*
*/
@ManagedBean(name=usuarioBean)
@RequestScoped
public class UsuarioBean {
private Usuario usuario = new Usuario();
private String confirmarSenha;
/**
* @return the usuario
*/
public Usuario getUsuario() {
return usuario;
}
/**
* @param usuario the usuario to set
*/
public void setUsuario(Usuario usuario) {
this.usuario = usuario;
}
/**
* @return the confirmarSenha
*/
public String getConfirmarSenha() {
return confirmarSenha;
}
/**
* @param confirmarSenha the confirmarSenha to set
*/
public void setConfirmarSenha(String confirmarSenha) {
this.confirmarSenha = confirmarSenha;
}
public String novo(){
this.usuario = new Usuario();
usuario.setAtivo(true);
return usuario;
}
public String salva(){
FacesContext context = FacesContext.getCurrentInstance();
String senha = this.usuario.getSenha();
if(!senha.equals(this.confirmarSenha)){
FacesMessage facesMessage = new FacesMessage(A senha não foi confirmada.);
context.addMessage(null, facesMessage);
return null;
}
UsuarioRN usuarioRN = new UsuarioRN();
usuarioRN.salvar(usuario);
return usuarioSucesso;
}
}
obrigado pela atenção!
30/10/2011
Robson Teixeira
30/10/2011
Ismael Oliveira
SEGUE:
/**
* @return the nascimaento
*/
public Date getNascimaento() {
return nascimento;
}
/**
* @param nascimaento the nascimaento to set
*/
public void setNascimaento(Date nascimento) {
this.nascimento = nascimento;
}
30/10/2011
Davi Costa
/**
* @return the nascimaento
*/
public Date getNascimaento() {
return nascimento;
}
/**
* @param nascimaento the nascimaento to set
*/
public void setNascimaento(Date nascimento) {
this.nascimento = nascimento;
}
att Davi
31/10/2011
Ismael Oliveira
kkkkkkkkkkkkkkkkkk!
preciso de umas ferias!!!
VLW PELA FORÇA!
31/10/2011
Davi Costa
att Davi
09/11/2011
Dyego Carmo
Qualquer coisa estou a disposição :)
Se sim , poderia fechar o chamado ?
Clique aqui para fazer login e interagir na Comunidade :)