Olá, pessoal. Estou tentando rodar um pequeno código aqui, mas não está dando certo. Sou iniciante em JSF. Alguém pode me ajudar, abaixo segue .jsp, .java, .xml e o erro.
jsp:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Entrada de Dados</title>
</head>
<body>
<h:form>
<h:outputLabel value="Digite seu nome"/>
<h:inputText value="#{pessoa.nome}" />
<h:commandButton value="Enviar" action="#{pessoa.enviar}"/>
</h:form>
<h1>
<h:outputText value="Seu nome em maiuculo eh #{pessoa.nome}" rendered="#{pessoa.nome!=NULL}"/>
</h1>
</body>
</html>
</f:view>
java:
package com.bean;
public class PessoaBean {
private String nome;
private int idade;
private String senha;
public PessoaBean() {
}
public void setIdade(int idade) {
this.idade = idade;
}
public void setNome(String nome) {
this.nome = nome;
}
public void setSenha(String senha) {
this.senha = senha;
}
public int getIdade() {
return idade;
}
public String getNome() {
return nome;
}
public String getSenha() {
return senha;
}
public void enviar(){
this.setNome(this.getNome().toUpperCase());
}
}
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">
<managed-bean>
<managed-bean-name>pessoa</managed-bean-name>
<managed-bean-class>com.bean.PessoaBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>
ERRO:
type Exception report
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Cant instantiate class: com.bean.PessoaBean.. com.bean.PessoaBean
root cause
javax.faces.FacesException: Cant instantiate class: com.bean.PessoaBean.. com.bean.PessoaBean
root cause
java.lang.ClassNotFoundException: com.bean.PessoaBean
note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server 9.1_02 logs.
Como sou iniante em jsf, não consegui identificar essa exeção. Alguém poderia me ajudar?
Desde já, agradeço…