James Strachan wrote:
> Pierre:
> ====
> the main problem I noticed when patching the <xsl:apply> tag to be
> pipeline-aware is that having a single property of type Object lead to
> problems. For example the <xsl:apply> tag started life having a property
>
> public void setXml(Object object);
>
> But I then got JSP compile errors when I tried to use it as:-
>
> <xsl:apply xml="foo.xml"/>
>
> I kept getting compile errors saying "couldn't convert from compile time
> type to Object" which I thought was strange. The workaround was to use the
> ugly scriplet expression form instead:-
>
> <xsl:apply xml='<%= "foo.xml" %>'/>
>
> Maybe thats another limitation of the current JSP spec? Or maybe a Tomcat
> bug.
There's been lots of discussions on that topic on tomcat-{user,dev}.
This is an issue that should be resolved by the expert group before
JSP1.2 becomes final.
Currently, the JSP1.2 spec says the following: (section 10.1)
"Attribute values in a JSP page are described as strings, but the corresponding
properties of the
tag handler may be have other types. The following conversions are done.
When the attribute is a request-time attribute value, no conversion is done, i.e.
types must
match exactly.
When the attribute is a literal string, if there is a PropertyEditor associated
with the JavaBean component, then, the setAsText() method will be used.
Otherwise, the rules in Table 2-4, section 2.13.2 will be followed."
[Actually, this should read "table 4-1, section 4.2"]
It has been argued that String -> Object should be allowed, given the
widening conversion rules of the JLS (section 5.1.4).
We'll see what the expert group decides.
-- Pierre