Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JavaServer Faces » Error getting property from bean
Error getting property from bean [message #612066] Mon, 25 June 2007 10:12
Eclipse UserFriend
Originally posted by: killahyo.gmail.com

Hello everybody, I'm developing a very simple example application and I'm
having some trouble with it... well, first of all I'll show you some code.

- 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">

<!-- =========== FULL CONFIGURATION FILE
================================== -->

<faces-config>

<managed-bean>
<description>
present
</description>
<managed-bean-name>present</managed-bean-name>

<managed-bean-class>udg.ada.cotxes.presentacio.ConPresentacio </managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>

</faces-config>
----------------------------------


- ConPresentacio.java:

package udg.ada.cotxes.presentacio;

import java.util.Vector;
import udg.ada.cotxes.negoci.*;

public class ConPresentacio {
String dni;
String model;
String color;

public ConPresentacio()
{
dni = new String();
model = new String();
color = new String();

}

public void setdni(String dniTreb)
{

dni = dniTreb;
}

public void setModel(String m)
{

model = m;
}

public void setColor(String c)
{

color = c;
}

public Vector CConcessionari()
{
negoci n = new negoci();

return n.CercaConcessionari(dni, model, color);
}

public Vector LlConcessionari()
{
negoci n = new negoci();

return n.LlConcessionaris(dni);
}

}
----------------------------------


- There is a presentation page, it provides a link to the main site, these
presentation page only has html code, so I won't post it here. The above
mentioned main site is index.jsp (go directly to JSF section):

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library...
action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
--%>

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<style>
BODY {
SCROLLBAR-FACE-COLOR: #555555; SCROLLBAR-HIGHLIGHT-COLOR: #333333;
SCROLLBAR-SHADOW-COLOR: #333333; SCROLLBAR-3DLIGHT-COLOR: #000000;
SCROLLBAR-ARROW-COLOR: #DDDDDD; SCROLLBAR-TRACK-COLOR: #999999;
SCROLLBAR-DARKSHADOW-COLOR: #000000;
}
</style>

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<title>ADA Xarxa de Concessionaris</title>
<style type="text/css">
<!--

#Layer6 {
position:absolute;
width:500px;
height:150px;
z-index:3;
left:0px;
top: 0px;
background-image: url(Layer13.jpg);
overflow: visible;
background-image: url(Layer13.jpg);
}
#Layer7 {
position:absolute;
width:100px;
height:150px;
z-index:4;
left: 500px;
top: 0px;
background-image: url(Layer14Stripes.jpg);
background-image: url(Layer14Stripes.jpg);
}
#Layer8 {
position:absolute;
width:56px;
height:149px;
z-index:5;
left: 599px;
top: 0px;
background-image: url(Layer15Stripes.jpg);
background-image: url(Layer15Stripes.jpg);
}

Estilo2 {color: #FFFFFF; font-family: Arial, Helvetica, sans-serif;
font-size: 12px; font-weight: bold; }
Estilo3 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #FFFFFF;
}
-->
</style>
</head>

<body bgcolor="#DDDEEF" background="Fons.jpg">
<div id="Layer8"></div>

<div id="Layer6"><img src="Title.jpg" alt="Site Title" width="500"
height="100" longdesc="Site Title" /></div>
<div id="Layer7">
<p>&nbsp; </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>

<f:view locale="ca_ES" >
<br></br>
<br></br>
<br></br>
<br></br>
<hr />
<h:form>
<table width="100%" border="0" cellpadding="5" bordercolor="#FFFFFF" >
<tr>
<td>
<p class="formulari">DNI:</p>
<h:inputText id="dnitreballador" value="#{present.dni}"
required="true" maxlength="20" size="20" />
<h:message for="dnitreballador" showDetail="true"
style="color:red" styleClass="error"/>
</td>
</tr>
</table>

<br></br>
<h:commandButton id="submit" action="#{present.LlConcessionari}"
value="Cerca" styleClass="botogros" />
</h:form >
<hr />
</f:view>

</body>
</html>
----------------------------------

- and I get this error:

org.apache.jasper.JasperException: javax.servlet.jsp.JspException: Error
getting property 'dni' from bean of type
udg.ada.cotxes.presentacio.ConPresentacio
----------------------------------

Help me please! thank you very much
Previous Topic:Validation for keywords contributed by standard variable resolvers
Next Topic:Error getting property from bean
Goto Forum:
  


Current Time: Tue Apr 23 10:31:47 GMT 2024

Powered by FUDForum. Page generated in 0.02734 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top