Ola Pessoal ! eu estou tendo um problema muito chato com meu JSP. Me chamo Rodrigo e sou iniciante na linguagem Java, na qual estou apanhando muito. Vou fazer um breve resumo do meu codigo pra facilitar pra todos que quizerem me ajuda, ok? :D
quando compilo o meu codigo, acontece o seguinte erro....: :shock:
javax.servlet.jsp.el.ELException: Unable to find a value for "inserir" in object of class "Imobiliaria.CadUsuario" using operator "."
at org.apache.commons.el.Logger.logError(Logger.java:481)
at org.apache.commons.el.Logger.logError(Logger.java:498 )
at org.apache.commons.el.Logger.logError(Logger.java:611)
ALGUEM SABE O QUE É ISSO???
Prra facilitar vou deixar parte do meu codigo:
/* Classe de Cadastro de Cliente*/
==================================
package Imobiliaria;
import java.sql.SQLException;
public class CadUsuario {
private int codusuario;
private String login;
private String senha;
private String nome;
private String endereço;
private String numero;
private String bairro;
private String cep;
private String uf;
private String fone1;
private String fone2;
private String fax;
private String email;
public CadUsuario() {
}
public int getCodusuario() {
return codusuario;
}
public void setCodusuario(int codusuario) {
this.codusuario = codusuario;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getSenha() {
return senha;
}
public void setSenha(String senha) {
this.senha = senha;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEndereço() {
return endereço;
}
public void setEndereço(String endereço) {
this.endereço = endereço;
}
public String getNumero() {
return numero;
}
public void setNumero(String numero) {
this.numero = numero;
}
public String getBairro() {
return bairro;
}
public void setBairro(String bairro) {
this.bairro = bairro;
}
public String getCep() {
return cep;
}
public void setCep(String cep) {
this.cep = cep;
}
public String getUf() {
return uf;
}
public void setUf(String uf) {
this.uf = uf;
}
public String getFone1() {
return fone1;
}
public void setFone1(String fone1) {
this.fone1 = fone1;
}
public String getFone2() {
return fone2;
}
public void setFone2(String fone2) {
this.fone2 = fone2;
}
public String getFax() {
return fax;
}
public void setFax(String fax) {
this.fax = fax;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String inserir(){
Facate f = new Facate();
try {
return f.inserir(this);
} catch (SQLException ex) {
ex.printStackTrace();
}
return null;
}
}
/*Parte do DAO do Cadastro*/
==========================================
//Classe CadUsuarioDAO
public String salvar(CadUsuario c){
try{
inserir.setString(1, c.getNome());
inserir.setString(2, c.getEndereço());
inserir.setString(3, c.getBairro());
inserir.setString(4, c.getCep());
inserir.setString(6, c.getUf());
inserir.setString(7, c.getNumero());
inserir.setString(8, c.getFone1());
inserir.setString(9, c.getFone2());
inserir.setString(10, c.getSenha());
inserir.setString(11, c.getLogin());
inserir.setString(12, c.getFax());
inserir.setString(13, c.getEmail());
inserir.setInt(14, c.getCodusuario());
inserir.executeUpdate();
}catch (Exception e){
e.printStackTrace();
}
return null;
}
=============================================
*/facade */
==============================================
package Imobiliaria;
import java.lang.*;
import java.sql.SQLException;
public class Facate {
private Database db;
public Facate() {
}
public String inserir(CadUsuario cadusuario) throws SQLException {
Database db = new Database();
CadUsuarioDAO cdao = new CadUsuarioDAO(db);
return cdao.salvar(cadusuario);
}
}
=============================================
/* JSP de Validação do Formulario*/
=============================================
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@page import="java.lang.String"%>
<jsp:useBean id='bnProjeto' class='Imobiliaria.CadUsuario'>
<c:set target='${bnProjeto}' property='login' value='${param.login}' />
<c:set target='${bnProjeto}' property='senha' value='${param.senha}'/>
<c:set target='${bnProjeto}' property='nome' value='${param.nome}'/>
<c:set target='${bnProjeto}' property='endereço' value='${param.endereço}'/>
<c:set target='${bnProjeto}' property='bairro' value='${param.bairro}'/>
<c:set target='${bnProjeto}' property='numero' value='${param.numero}'/>
<c:set target='${bnProjeto}' property='cep' value='${param.cep}'/>
<c:set target='${bnProjeto}' property='uf' value='${param.uf}'/>
<c:set target='${bnProjeto}' property='fone1' value='${param.fone1}'/>
<c:set target='${bnProjeto}' property='fone2' value='${param.fone2}'/>
<c:set target='${bnProjeto}' property='fax' value='${param.fax}'/>
<c:set target='${bnProjeto}' property='email' value='${param.email}'/>
</jsp:useBean>
<c:set var="retorno" value="${bnProjeto.inserir}"/> // aciona o metodo inserir do CadUsuario....
[color=blue]alguem sabe o pq do erro descrito acima????[/color] :!:me ajudem! , please :!: