Olá
Mais uma vez estou aqui pedindo a ajuda de vocês com o JSF: eu criei uma pagina para cadastrar um usuário e senha apenas, então no meu backBean, eu coloquei o metodo inserir() que foi chamado em um
HTTP Status 500 -type Exception report
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: #{usuario.inserir}: javax.el.MethodNotFoundException: Method not found: [email removido]()
root causejavax.faces.FacesException: #{usuario.inserir}: javax.el.MethodNotFoundException: Method not found: [email removido]()
root causejavax.faces.el.MethodNotFoundException: javax.el.MethodNotFoundException: Method not found: [email removido]()
root causejavax.el.MethodNotFoundException: Method not found: [email removido]()
note The full stack traces of the exception and its root causes are available in the Sun GlassFish Enterprise Server v2.1 logs.
Eis os trechos do códigos correspondente:
FacesConfig.xml<?xml version='1.0' encoding='UTF-8'?>
<!-- =========== FULL CONFIGURATION FILE ================================== -->
<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
<navigation-rule>
<from-view-id>/index.jsp</from-view-id>
<navigation-case>
<from-outcome>cadUsuario</from-outcome>
<to-view-id>/cadUsuario.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<managed-bean>
<managed-bean-name>usuario</managed-bean-name>
<managed-bean-class>br.com.wmsolucoes.netbuilder.entidade.Usuario</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>
Usuario.java
...
public String inserir(Usuario u) {
UsuarioDAO dao = new UsuarioDAO();
if (dao.save(u)) {
resultado = SUCESSO;
return resultado;
} else {
resultado = FALHA;
return resultado;
}
}
...
[b]cadUsuario.jsp
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<html>
<body>
<f:view>
<h1>Cadastrar Usuario</h1>
<h:form>
<h:inputText value="#{usuario.login}" />
<h:inputSecret value="#{usuario.senha}" />
<h:commandButton value="Cadastrar'" action="#{usuario.inserir}" />
</h:form>
</f:view>
</body>
</html>
Alguem poderia me ajudar e ensinar o que estou fazendo de errado ???
Obrigado