Sou nova no mundo java, alguém por favor pode me ajudar?
Estou com a seguinte situação:
instalei o java jdk1.6.0_31
apache-tomcat-6.0.35
eclipse indigo
possuo os seguintes arquivos na libraries:
commons-logging-1.1.1.jar
commons-collections-3.2.1.jar
commons-digester3-3.2.jar
commons-beanutils-1.8.3.jar
jstl-impl-1.2.jar
jstl-api-1.2.jar
jsf-api.jar
jsf-impl.jar
o arquivo web.xml:
<?xml version=“1.0” encoding=“UTF-8”?>
<web-app xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns=“http://java.sun.com/xml/ns/javaee” xmlns:web=“http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd” xsi:schemaLocation=“http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd” id=“WebApp_ID” version=“2.5”>
<display-name>FinanceiroWeb</display-name>
<servlet>
<display-name>Faces Servlet</display-name>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Usuario.xhtml
<?xml version=“1.0” encoding=“ISO-8859-1” ?>
<!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>
<meta http-equiv=“Content-Type” content=“text/html; charset=ISO-8859-1” />
<title>Cadastro de Usuários</title>
</h:head>
<h:body>
<h1>Cadastro de Usuários</h1>
<hr />
<h:form>
<h:messages />
<h:panelGrid columns=“2”>
<h:outputLabel value=“Nome:” for=“nome”/>
<h:inputText id=“nome” label=“Nome” value="#{usuarioBean.nome}" required=“true”/>
<h:outputLabel value=“e-Mail:“for=“email”/>
<h:inputText id=“email” label=“e-Mail” value=”#{usuarioBean.email}”/>
<h:outputLabel value=“Senha”: for=“senha”/>
<h:inputSecret id=“senha” label=“Senha” value="#{usuarioBean.senha}" required=“true”/>
<h:outputLabel value=“Confirmar Senha:” for=“confirmarsenha”/>
<h:inputSecret id=“confirmarsenha” label=“Confirmar Senha” value="#{usuarioBean.confirmaSenha}"
required=“true”/>
<h:outputText/>
<h:commandButton action="#{usuarioBean.salvar}" value=“Salvar”/>
</h:panelGrid>
</h:form>
<hr/>
</h:body>
</html>
faces-config-xml
<?xml version=“1.0” encoding=“ISO-8859-1” ?>
<!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>
<meta http-equiv=“Content-Type” content=“text/html; charset=ISO-8859-1” />
<title>Cadastro de Usuários</title>
</h:head>
<h:body>
<h1>Cadastro de Usuários</h1>
<hr />
<h:form>
<h:messages />
<h:panelGrid columns=“2”>
<h:outputLabel value=“Nome:” for=“nome”/>
<h:inputText id=“nome” label=“Nome” value="#{usuarioBean.nome}" required=“true”/>
<h:outputLabel value=“e-Mail:“for=“email”/>
<h:inputText id=“email” label=“e-Mail” value=”#{usuarioBean.email}”/>
<h:outputLabel value=“Senha”: for=“senha”/>
<h:inputSecret id=“senha” label=“Senha” value="#{usuarioBean.senha}" required=“true”/>
<h:outputLabel value=“Confirmar Senha:” for=“confirmarsenha”/>
<h:inputSecret id=“confirmarsenha” label=“Confirmar Senha” value="#{usuarioBean.confirmaSenha}"
required=“true”/>
<h:outputText/>
<h:commandButton action="#{usuarioBean.salvar}" value=“Salvar”/>
</h:panelGrid>
</h:form>
<hr/>
</h:body>
</html>
Classe
package financeiro.web;
import java.util.Map;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;
@ManagedBean(name=“usuarioBean”)
@RequestScoped
public class UsuarioBean {
private String nome;
private String email;
private String senha;
private String confirmaSenha;
@ManagedProperty(value="#{param}")
private Map<String, String> parametros;
public String novo(){
return "usuario";
}
public String salvar(){
FacesContext context = FacesContext.getCurrentInstance();
if (!this.senha.equalsIgnoreCase(this.confirmaSenha)) {
context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR,
"Senha confirmada incorretamente",""));
return "usuario";
}
//Salva o usuario
return "sucesso";
}
public Map<String, String> getParametros() {
return parametros;
}
public void setParametros(Map<String, String> parametros) {
this.parametros = parametros;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getSenha() {
return senha;
}
public void setSenha(String senha) {
this.senha = senha;
}
public String getConfirmaSenha() {
return confirmaSenha;
}
public void setConfirmaSenha(String confirmaSenha) {
this.confirmaSenha = confirmaSenha;
}
}
No entanto quando rodo:
http://localhost:8086/FinanceiroWeb/usuario.jsf
aparece a seguinte msg:
An Error Occurred:
null source
± Stack Trace
java.lang.IllegalArgumentException: null source
at java.util.EventObject.<init>(Unknown Source)
at javax.faces.event.SystemEvent.<init>(SystemEvent.java:67)
at javax.faces.event.ComponentSystemEvent.<init>(ComponentSystemEvent.java:69)
at javax.faces.event.PostRestoreStateEvent.<init>(PostRestoreStateEvent.java:69)
at com.sun.faces.lifecycle.RestoreViewPhase.deliverPostRestoreStateEvent(RestoreViewPhase.java:256)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:245)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:107)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
± Component Tree
± Scoped Variables
POR FAVOR ALGUÉM ME AJUDE!
Desde já, agradeço
Clelia