"Craig R. McClanahan" wrote:
>
> Serge Knystautas wrote:
>
> > [snip]
> > The way I got this to work was to overload the setter method to take
both a
> > String and an Object... this got it working through Jasper Servlet but
not
> > jspc. I don't know if that's a violation of the spec or the way to
handle
> > this issue.
>
> Yep, it is, and again this is made explicit in JSP 1.2 :-(.
I've been agonizing over this days reading over the spec again and again and
immersing myself in the bean API. First, I really don't think the spec
intends to require attr='<%="value"%>' and in fact in JSP 1.2 it specifies
how you write your tag to support attr="value".
I endeavored to use the bean API as the JSP spec tells me to. After I
finish my tag, I created a <Tagname>BeanInfo which returns an array of
PropertyDescriptor objects defining my properties. Then I write a
<Tagname><Propertyname>PropertyEditor class and set this on the
PropertyDescriptor for that property that is a java.lang.Object. My
<Tagname><Propertyname>PropertyEditor class overrides setAsText(String)
which according to section 4.2 of the JSP 1.2 spec, should allow me to pass
a String constant to this property.
So my problem is... there's no way in Tomcat 3.2b7 to do attr="value" if
your attr is an Object property. I can use Tomcat 3.1 and could use Tomcat
4.0 (assuming this part is implemented), but not Tomcat 3.2b7. The "rigor"
was added to prevent you from passing a String constant directly to an
Object property, but the way to support this through a PropertyEditor class
is not added.
I see this as an isolated but critical flaw in the implementation of the
spec. As I see it, you can either relax the recent restriction made (by
allowing a String to convert to an Object... my 2 line patch) or you can add
support for tags with a PropertyEditor. I don't really want to hold up
Tomcat 3.2, and since it doesn't really need to support JSP 1.2 just yet, I
would suggest making it so that tags can pass a String constant directly to
an Object property (which in my opinion complies with JSP 1.1, even though
not JSP 1.2).
Anyway, I hope this sheds some light on my plight, and maybe someone can
decide on a remedy. I believe the patch to add support for PropertyEditors
is non-trivial, otherwise I'd try to write it myself and submit. Maybe
Eduardo can also shed light on this issue and how he envisions the spec
migration happening.
> > Anyway, seems that if spec compliance is an issue, we should
> > have Tomcat 3.2 be uniform in both jspc and the Jasper Servlet.
>
> That is *definitely* true. Unfortunately, I'm not the person most versed
with
> the JSP compiler. Pierre Delisle is, and he will also be back on Monday.
I haven't had the chance to test this, as I've been spending my time trying
to figure a way out for my tags rather than make sure they don't work. ;)
Serge Knystautas
Loki Technologies
http://www.lokitech.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]