Thanks for the info Hans. That solved my problem. I was looking in exactly
the wrong area. I figured I was passing the data wrong, when in fact I was
describe what I was passing wrong.
Either way thanks a million,
jb
-----Original Message-----
From: Hans Bergsten [mailto:[EMAIL PROTECTED]]
Sent: Wed 2/19/2003 5:10 PM
To: Tag Libraries Users List
Cc:
Subject: Re: Can I use MyClass as a attribute
Jeff Born wrote:
> I'm not getting much of a response to my question. Is this because
I didn't
> provide enough information? Is it just not possible and no one
wants to hurt
> my feelings?
>
> Can I have an object as an attribute? Or can it only be a string?
In my
> case I would want the attribute to be of class hCategories. NOTE:
> hCategories is not a java bean.
What you want to do works (if I understand you correctly). The main
problem seems to be that you have not declared the attribute to
accept
a "request-time attribute value", i.e. an expression like
"<%=categoryData%>", so the JSP container treats it as a static
string
value instead of evaluating the expression and setting the attribute
to the resulting value.
Add
<attribute>
...
<rtexprvalue>true</rtexprvalue>
</attribute>
for the tag in the TLD to declare that the attribute accepts request-
time attribute values.
Hans
> -----Original Message-----
> From: Jeff Born
> Sent: Wed 2/19/2003 10:08 AM
> To: [EMAIL PROTECTED]
> Cc:
> Subject: Can I use MyClass as a attribute
>
>
>
> // Tag snippet
> private hCategories categories=null;
> /**
> * Getter/Setter for the attribute name as defined in the tld
file
> * for this tag
> */
> public void setCategories(hCategories value){
> categories = value;
> }
> public hCategories getCategories(){
> return(categories);
> }
> JSP call:
> <dl:productView categories="<%=categoryData%>" />
>
>
>
> Error message that is created:
>
> Unable to convert string '<%=categoryData%>' to class
> com.harland.datatypes.hCategories for attribute categories:
> java.lang.IllegalArgumentException: Property Editor not
registered
> with the
> PropertyEditorManager
>
> Using Tomcat 4.1.18
>
> First can I do this? Then if I can how do I pass the
hCategories
> object?
>
>
>
> Thanks,
>
> Jeff Born
>
--
Hans Bergsten
<[EMAIL PROTECTED]>
Gefion Software
<http://www.gefionsoftware.com/>
Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL
1.0
Details at
<http://TheJSPBook.com/>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]