Hmm..

it would help to see the code for myproject.beans.ConceptBean.

However,...

make sure the bean has public methods ...

    getLabel()
    getId_number()

Quite frankly I think this whole JSP getProperty thing is way overrated.
I just create this simple data beans, put them in the session or request,
and the just access them with jsp expressions.

Eg, here is a a class...

public class SomeDataBag {
    private String theFacts;

    public String justTheFactsMaam() {
          return theFacts;
    }
}

then in the JSP we might have...  (import stmt ommitted)...
<jsp:useBean id="evidencebag" scope="request" class="mypackage.SomeDataBag"/>

<HTML>
....
And the facts are: <%= evidencebag.justTheFactsMaam() %>

>From an html aesthetics perspective this seems cleaner than
the getProperty syntax.


-----Original Message-----
From: sufi malak <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Sunday, September 24, 2000 10:05 PM
Subject: What's wrong with this code ??


>This the error I got :
>
>500 Internal Server Error
>Java Server Page Translation Error
>Error during page parsing:
>com.sun.server.http.pagecompile.jsp.JspException: getProperty(concept): cant
>find method to read {1}
>
>And this is the JSP code :
><%@ page import="myproject.beans.*" errorPage="error.jsp" %>
><jsp:useBean id="concept" class="myproject.beans.ConceptBean"/>
><%
>  ConceptBean[] concepts = concept.getConceptBeans();
>%>
><html>
><head>
><title>Browse for a node</title>
><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
></head>
>
><body bgcolor="#FFFFFF">
><form method="post" action="">
>  <table width="10" border="0" cellspacing="0" cellpadding="0"
>align="center">
>    <tr bgcolor="#FFFFCC">
>      <td><font face="Verdana, Arial, Helvetica, sans-serif" color="#0000CC"
>size="2">Click
>        on a node in this list then click on &quot;select&quot; to choose
>it.</font></td>
>    </tr>
>    <tr>
>      <td>
>        <div align="center">
>          <select name="select" size="10">
>    <%
>    for (int i=0; i < concepts.length; i++) {
>    concept = concept[i];
>    %>
>
>        <option value="<jsp:getProperty name="concept"
>property="id_number"/>">
>        <jsp:getProperty name="concept" property="id_number"/>
>        <jsp:getProperty name="concept" property="label"/>
>        </option>
>    <% } %>
>
>
>          </select>
>        </div>
>      </td>
>    </tr>
>    <tr>
>      <td>
>        <table width="100%" border="0" cellspacing="0" cellpadding="0">
>          <tr>
>            <td>
>              <div align="right">
>                <input type="submit" name="Submit" value="Submit">
>              </div>
>            </td>
>            <td>
>              <div align="left">
>                <input type="submit" name="Submit2" value="Submit">
>              </div>
>            </td>
>          </tr>
>        </table>
>      </td>
>    </tr>
>  </table>
></form>
></body>
></html>
>
>_________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>Share information about yourself, create your own public profile at
>http://profiles.msn.com.
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to