Pessoal,
Estou tentando tentando executar um pequeno aplicativo e está ocorrendo o seguinte erro :
"HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /cadastraUsuario.jsp(42,4) The function validaSenha must be used with a prefix when a default namespace is not specified"
no seguinte trecho de codigo
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WebUserManager - Cadastramento de Usuário</title>
</head>
<body>
<f:view>
<h:outputText value="Preencha os dados do Usuário" />
<br />
<br />
<h:form>
<h:panelGrid columns="3">
...
<h:commandButton type="submit" value="Enviar" action="#{UsuarioBean.validaSenha()}"/>
</h:panelGrid>
</h:form>
</f:view>
</body>
</html>
Segue abaixo o meu faces-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer
Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<managed-bean>
<managed-bean-name>
loginForm
</managed-bean-name>
<managed-bean-class>
beans.LoginFormBean
</managed-bean-class>
<managed-bean-scope>
session
</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>
UsuarioBean
</managed-bean-name>
<managed-bean-class>
beans.UsuarioBean
</managed-bean-class>
<managed-bean-scope>
session
</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/login.jsp</from-view-id>
<navigation-case>
<from-outcome>menu</from-outcome>
<to-view-id>/menu.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/login.jsp</from-view-id>
<navigation-case>
<from-outcome>falha</from-outcome>
<to-view-id>/erro_login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/cadastraUsuario.jsp</from-view-id>
<navigation-case>
<from-outcome>sucesso</from-outcome>
<to-view-id>/exibeUsuario.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/cadastraUsuario.jsp</from-view-id>
<navigation-case>
<from-outcome>falha</from-outcome>
<to-view-id>/erro_cadastro.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
E a minha classe UsuarioBean
package beans;
public class UsuarioBean {
private String cpf;
private String nome;
private String senha;
private String confirmaSenha;
private String emailPrincipal;
private String emailAlternativo;
private String telefone;
private String perfil;
private String status;
private String retorno="";
public UsuarioBean() {
}
// metodos get() e set()
/* ... */
// metodo validaSenha
public String validaSenha() {
if ( this.senha.equals(this.confirmaSenha )) {
this.retorno = "sucesso";
} else {
this.retorno = "falha";
}
return retorno;
}
}
Por qual motivo está dando problema nesse “namespace” quando o método de UsuarioBean é chamado a partir da página de cadastro ?
Agradece,
Max Carvalho