You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Rick Ross <rr...@stupendousman.com> on 2003/08/23 09:24:41 UTC

Unable to find value using operator "." (null)

I have a class called RTime. It has the following get methods (and no SET
methods):

    public String getCrazy()
    public String getUSTime()
    public String getISOTime()

 One of my custom tags places an object of this type into the pageContext.
The US and ISO time methods work perfectly, but the Crazy method fails to
compile

    <stup:makeTime var="timeOb" time="${param.time}" />
    <c:out value="${timeOb.ISOTime}" />
    <c:out value="${timeOb.USTime}" />
    <c:out value="${timeOb.Crazy}" />

Here is the error message:

    An error occurred while evaluating custom action attribute "value" with
value
    "${timeOb.Crazy}": Unable to find a value for "Crazy" in object of class
    "stupendous.tags.datetime.RTime" using operator "." (null)

Now, also on the page, I iterate through all of the contexts in page (page,
application, etc.) and spit out the results.  As long as I comment out the
'Crazy' call, I can clearly see that I have a stupendous.tags.datetime.RTime
object.  (of course, if I didn't, I would get nothing back from the ISO and
US time functions.  But I do.  I get exactly what I expect from each of
them.

I've renamed the method a dozen times.  Added a matching setter method,
renamed the class, added and removed other get methods ... nothing changes
the fact that it, and new methods, will not work..  of course, if I replace
the last c:out with:

 <%
      stupendous.tags.datetime.RTime t =
(stupendous.tags.datetime.RTime)pageContext.getAttribute("timeOb");
      pageContext.getOut().println(t.getCrazy());
  %>

It works perfectly.

Any thoughts?

Rick



Re: Unable to find value using operator "." (null)

Posted by Rick Ross <rr...@stupendousman.com>.
OMG... I could swear that was the first thing I tried.    Thanks.

BTW, I really wish your book was on Safari.


R

----- Original Message ----- 
From: "Shawn Bayern" <ba...@essentially.net>
To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
Sent: Saturday, August 23, 2003 1:20 AM
Subject: Re: Unable to find value using operator "." (null)


> On Sat, 23 Aug 2003, Rick Ross wrote:
>
> > I have a class called RTime. It has the following get methods (and no
SET
> > methods):
> >
> >     public String getCrazy()
> >     public String getUSTime()
> >     public String getISOTime()
>
> With these methods (and the rest of what you describe), you have the
> following JavaBeans properties:
>
> crazy
> USTime
> ISOTime
>
> Your capitalization of multiple leading letters in the last two accessor
> methods causes the JavaBeans introspector to preserve the capitalization
> you use; the default pattern, however, is for getXxx() to refer to a
> property named 'xxx', not 'Xxx'.  (For more information, see the JavaBeans
> specification.)
>
> > I've renamed the method a dozen times.  Added a matching setter method,
> > renamed the class, added and removed other get methods ... nothing
> > changes the fact that it, and new methods, will not work..
>
> Changing the method, and adding other classes, won't help.  Just refer to
> the property as ${foo.crazy}.
>
> -- 
> Shawn Bayern
> "JSTL in Action"   http://www.jstlbook.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>


Re: Unable to find value using operator "." (null)

Posted by Shawn Bayern <ba...@essentially.net>.
On Sat, 23 Aug 2003, Rick Ross wrote:

> I have a class called RTime. It has the following get methods (and no SET
> methods):
>
>     public String getCrazy()
>     public String getUSTime()
>     public String getISOTime()

With these methods (and the rest of what you describe), you have the
following JavaBeans properties:

	crazy
	USTime
	ISOTime

Your capitalization of multiple leading letters in the last two accessor
methods causes the JavaBeans introspector to preserve the capitalization
you use; the default pattern, however, is for getXxx() to refer to a
property named 'xxx', not 'Xxx'.  (For more information, see the JavaBeans
specification.)

> I've renamed the method a dozen times.  Added a matching setter method,
> renamed the class, added and removed other get methods ... nothing
> changes the fact that it, and new methods, will not work..

Changing the method, and adding other classes, won't help.  Just refer to
the property as ${foo.crazy}.

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com