Yeah, I'm familiar with the map notation. Unfortunately, this is a List. All
the other values for this object are printing fine, just not the 'id'. I've
chalked this one up as a loss and am simply using another method (getID(),
as opposed to getId())to get the value.

The sunspots must still be in full effect. LOL.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, November 04, 2003 11:37 AM
> To: Tag Libraries Users List
> Cc: 'Tag Libraries Users List'
> Subject: RE: <c:out> unable to find value
> 
> 
> 
> 
> 
> 
> 
> Hey Steve-
> If you didn't figure it out here's another suggestion.  If 
> you are using a Map you might need to use the 
> name="myBean.value" notation.  It's a little different than 
> using List in iteration.
> 
> 
> Savan Thongvanh
> Berkley Technology Services
> 515.278.7725
> 
> 
>                                                               
>                                                               
>                  
>                       "Morrow, Steve                          
>                                                               
>                  
>                       D."                      To:       'Tag 
> Libraries Users List' <[EMAIL PROTECTED]>       
>                  
>                       <[EMAIL PROTECTED]        cc:            
>                                                               
>                  
>                       om>                      Subject:  RE: 
> <c:out> unable to find value                                  
>                   
>                                                               
>                                                               
>                  
>                       11/03/2003 04:43                        
>                                                               
>                  
>                       PM                                      
>                                                               
>                  
>                       Please respond to                       
>                                                               
>                  
>                       "Tag Libraries                          
>                                                               
>                  
>                       Users List"                             
>                                                               
>                  
>                                                               
>                                                               
>                  
>                                                               
>                                                               
>                  
> 
> 
> 
> 
> Yep - I know it works - I've done it before in other apps. 
> Just not here. :o(
> 
> Hopefully the sunspots will be gone by tomorrow...
> 
> > -----Original Message-----
> > From: Kris Schneider [mailto:[EMAIL PROTECTED]
> > Sent: Monday, November 03, 2003 4:31 PM
> > To: Tag Libraries Users List
> > Subject: Re: <c:out> unable to find value
> >
> >
> > I just hacked up a small example with JDK 1.4.2, Tomcat 4.1.24, and 
> > Standard 1.0.4 that works fine...
> >
> > Customer.java:
> > --------------
> >
> > package com.dotech;
> >
> > public class Customer {
> >
> >      private Integer id;
> >      private String name;
> >
> >      public Customer(Integer id, String name) {
> >          super();
> >          this.id = id;
> >          this.name = name;
> >      }
> >
> >      public Integer getId() {
> >          return this.id;
> >      }
> >
> >      public String getName() {
> >          return this.name;
> >      }
> > }
> >
> > customer.jsp:
> > -------------
> >
> > <%@ page contentType="text/plain" %>
> > <%@ page import="com.dotech.Customer" %>
> > <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
> >
> > <%
> > pageContext.setAttribute("customer",
> >                           new Customer(new Integer(42), 
> "Foo Bar")); 
> > %>
> >
> > Id:   <c:out value="${customer.id}"/>
> > Name: <c:out value="${customer.name}"/>
> >
> > Id: <jsp:getProperty name="customer" property="id"/>
> >
> > Gives:
> >
> > Id:   42
> > Name: Foo Bar
> >
> > Id: 42
> >
> > Morrow, Steve D. wrote:
> >
> > > <jsp:getProperty name="customer" property="id"/>
> > >
> > > ...gives me...
> > >
> > > "Cannot find a method to read property 'id' in a bean of type 
> > > 'ebus.common.Customer'"
> > >
> > > ...mind you, customer.getId() works just fine. I think solar 
> > > flares/sunspots is as good an explanation as any....
> > >
> > > I've already "cleaned house" three times today. Gack.
> > >
> > >
> > >>-----Original Message-----
> > >>From: Kris Schneider [mailto:[EMAIL PROTECTED]
> > >>Sent: Monday, November 03, 2003 3:14 PM
> > >>To: Tag Libraries Users List
> > >>Subject: RE: <c:out> unable to find value
> > >>
> > >>
> > >>Okay, so you've heard about all the solar flare activity, 
> right? I'm 
> > >>sure once that clears up it'll work just fine... Uh huh. What 
> > >>happens with:
> > >>
> > >><jsp:getProperty name="customer" property="id"/>
> > >>
> > >>You might have to do this before using it:
> > >>
> > >><jsp:useBean id="customer" type="pkg.name.Customer"/>
> > >>
> > >>I dunno, it's kooky. Make sure you've got JSTL installed 
> correcty, 
> > >>stop your app server and blow away the app's "work area" 
> (complied 
> > >>JSP files, etc), then restart. Yup, shotgunning at this point...
> > >>
> > >>Quoting "Morrow, Steve D." <[EMAIL PROTECTED]>:
> > >>
> > >>
> > >>>Oh yeah... <%= customer.getId() %> works, of course.
> > >>>
> > >>>
> > >>>>-----Original Message-----
> > >>>>From: Kris Schneider [mailto:[EMAIL PROTECTED]
> > >>>>Sent: Monday, November 03, 2003 2:42 PM
> > >>>>To: Tag Libraries Users List
> > >>>>Subject: Re: <c:out> unable to find value
> > >>>>
> > >>>>
> > >>>>You can use java.beans.Introspector.decapitalize to 
> tell you what 
> > >>>>the property name should look like. In this case,
> > >>>>Introspector.decapitalize("Id") results in "id", so you 
> should be 
> > >>>>fine. I'm sure that's helpful ;-). Are you positive that your 
> > >>>>scoped attribute "customer" actually references an instance of 
> > >>>>your Customer class? Here's another helpful snippet to 
> see all the 
> > >>>>properties exposed by your class:
> > >>>>
> > >>>>import java.beans.*;
> > >>>>...
> > >>>>BeanInfo info = Instrospector.getBeanInfo(Customer.class);
> > >>>>PropertyDescriptor[] props =
> > >>
> > >>info.getPropertyDescriptors(); for (int
> > >>
> > >>>>i = 0; i < props.length; i++) {
> > >>>>  System.out.println(props[i].getName());
> > >>>>}
> > >>>>
> > >>>>Quoting "Morrow, Steve D." <[EMAIL PROTECTED]>:
> > >>>>
> > >>>>
> > >>>>>I have a session-scoped bean structured (in part) as follows:
> > >>>>>
> > >>>>>public class Customer {
> > >>>>>
> > >>>>>    public Integer id;
> > >>>>>    public String name;
> > >>>>>
> > >>>>>    public Integer getId() {
> > >>>>>        return id;
> > >>>>>    }
> > >>>>>
> > >>>>>    public String getName() {
> > >>>>>        return name;
> > >>>>>    }
> > >>>>>}
> > >>>>>
> > >>>>>In the JSP, <c:out value="${customer.name}" /> works as
> > >>
> > >>expected.
> > >>
> > >>>>>However, <c:out value="${customer.id}" /> does not - it
> > >>
> > >>throws an
> > >>
> > >>>>>error that the JSP is "unable to find a value for "id" in
> > >>>>
> > >>>>object..." I
> > >>>>
> > >>>>>added the following method, which works fine with a value of
> > >>>>>${customer.ID}:
> > >>>>>
> > >>>>>public String getID() {
> > >>>>>    return id.toString();
> > >>>>>}
> > >>>>>
> > >>>>>I googled, but was unable to find an answer, or anyone 
> > >>>>>experiencing the same sort of problem. I'm sure I'm missing 
> > >>>>>something pretty simple, but I could use some more eyes on the 
> > >>>>>problem. Why
> > >>>>
> > >>>>is the tag
> > >>>>
> > >>>>>unable to find ${customer.id} (i.e. use the getId() method)?
> > >>>>>
> > >>>>>I am using Jakarta's 1.0.4 taglibs...
> >
> > --
> > Kris Schneider <mailto:[EMAIL PROTECTED]>
> > D.O.Tech       <http://www.dotech.com/>
> >
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: 
> [EMAIL PROTECTED]
> >
> 
> 
> This message and any files transmitted with it are 
> confidential and are intended solely for the use of the 
> individual or entity to whom they are addressed.  If you have 
> received this email in error, please delete the email and any 
> files transmitted with it entirely from your computer.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> CONFIDENTIALITY NOTICE: This e-mail and the transmitted 
> documents contain private, privileged and confidential 
> information belonging to the sender. The information therein 
> is solely for the use of the addressee.  If your receipt of 
> this transmission has occurred as the result of an error, 
> please immediately notify us so we can arrange for the return 
> of the documents. In such circumstances, you are advised that 
> you may not disclose, copy, distribute or take any other 
> action in reliance on the information transmitted.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


This message and any files transmitted with it are confidential and are
intended solely for the use of the individual or entity to whom they are
addressed.  If you have received this email in error, please delete the
email and any files transmitted with it entirely from your computer. 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to