You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ja...@cardsetc.com on 2000/04/06 05:44:47 UTC

Tag library: problems finding attribute.

Folks,

I am attempting to implement a simple Tag (called resources), with a single
attribute (bundle).

It throws a JasperException @
org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(JspRuntimeLibrary.java:211).

The exception's message is "Cannot find any information on property
'bundle' in a bean of type 'com.cardsetc.cx.web.tags.ResourcesTag'".

In my ResourcesTag class I have a method 'public void setBundle(String
bundle)'.

My understanding, based on reading the JSP1.1 spec, the Orion Server taglib
tutorials, and looking at the example tags delivered with Tomcat, is that
the required signature for setter methods in tags must be a public method,
returning void, taking a single java.lang.String argument, and called
setXxxx, where Xxxx is the name of the attribute, with the first letter
capitalised.

Correct?

I also tried adding a class that implements TagExtraInfo, which I didn't
think would solve the problem, and surprise, it didn't ;-)

I am running the Tomcat 3.1 beta code, so this may well be a bug that has
been fixed.  If not, and the feeling is that this might be a bug, then I'll
post it in Bugzilla shortly.

Regards,
James W.

==================================================================

Cards Etc will be on stand 1161 at CardTech SecurTech in Miami
from 2nd May to 4th May. Look forward to seeing you there!

==================================================================
This e-mail is from Cards Etc Pty Limited (ACN: 069 533 302).
This e-mail may contain privileged and confidential information.
It is intended for the named recipient(s) only.
If you are not an intended recipient, please notify us immediately
(by reply e-mail) and delete this e-mail from your system.
==================================================================



Re: Tag library: problems finding attribute.

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
JamesW@cardsetc.com wrote:
> 
> Folks,
> 
> I am attempting to implement a simple Tag (called resources), with a single
> attribute (bundle).
> 
> It throws a JasperException @
> org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(JspRuntimeLibrary.java:211).
> 
> The exception's message is "Cannot find any information on property
> 'bundle' in a bean of type 'com.cardsetc.cx.web.tags.ResourcesTag'".
> 
> In my ResourcesTag class I have a method 'public void setBundle(String
> bundle)'.
> 
> My understanding, based on reading the JSP1.1 spec, the Orion Server taglib
> tutorials, and looking at the example tags delivered with Tomcat, is that
> the required signature for setter methods in tags must be a public method,
> returning void, taking a single java.lang.String argument, and called
> setXxxx, where Xxxx is the name of the attribute, with the first letter
> capitalised.
> 
> Correct?
> 
> I also tried adding a class that implements TagExtraInfo, which I didn't
> think would solve the problem, and surprise, it didn't ;-)
> 
> I am running the Tomcat 3.1 beta code, so this may well be a bug that has
> been fixed.  If not, and the feeling is that this might be a bug, then I'll
> post it in Bugzilla shortly.

I general, the custom tag mechanism work fine in Tomcat 3.1, at least the
latest nightly builds. Possible reasons for the problem you see:
* You didn't have the method public (or some other error) the first time you 
  tried and even though you have now fixed it, Tomcat is still using the old
  version of your tag handler class. If so, restart Tomcat.
* You have more than one setBundle() method, with different argument types.
  The introspection classes refuse to recognize any property with the 
  corresponding name in this case, leading to the kind of message you see.

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com