I recently was getting a JasperException on page execution saying
"Cannot find a method to read property 'X' in a bean of type 'Y'."

I checked the tomcat-users archives and found mention of a message
"Cannot find any information on property X in bean of type Y".
Replies to that question were mostly reminding the developer
to make sure the names matched properly in a case-sensitive manner.

I doubled-checked that and found everything matched up correctly.
However, after staring at the code for the bean for some time and not 
seeing the problem I decided to fire up my IDE's JavaBean support tool
(I use JBuilder 4) and sure enough it indicated there were not "getter" 
methods, even though I had been looking at them all morning.  What was 
wrong was that they were not public -- there was no visibility modifier 
at all, making them default ("package"), and preventing the JSP from
accessing the properties.  Once I added the "public" keyword and
recompiled, everything was perfect.

Short summary: make sure your getters and setters are public.  Sometimes
an automated tool can point out things in your blindspot.

s

----
Omnis festinatio parte diaboli est
N  45° 25.306'
W 122° 44.276'

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

Reply via email to