<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=adamj" rel="nofollow">Adam Murray</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-2128?redirect=false" rel="nofollow">SPR-2128</a></strong> and commented</p>
<p dir="auto">The form implementation class org.springframework.web.servlet.tags.form.FormTag doesn't implement support for all the attributes it claims to support in the spring-form.tld. Specially, the attributes supported by code in the AbstractHtmlElementTag class are missing. This isn't a major problem on Tomcat, where things work fine until you try to use one of the unsupported attributes, like cssClass, and then the JSP fails to compile with the following error:<br>
Unable to find setter method for attribute: cssClass</p>
<p dir="auto">But the situation is worse on WebLogic 8.1, which appears to validate the TLD just by including the taglib on a page. I have a common taglibs.jsp page that includes all the taglibs needed by my app, even if they aren't used on a particular page. So I can't view any page in my application when using the spring form taglib and this "global include" type of approach, because all pages will display the following error:<br>
Error in using tag library uri='<a href="http://www.springframework.org/tags/form" rel="nofollow">http://www.springframework.org/tags/form</a>' prefix='form': The Tag class 'org.springframework.web.servlet.tags.form.FormTag ' has no setter method corresponding to TLD declared attribute 'cssClass', (JSP 1.1 spec, 5.4.1)</p>
<p dir="auto">I think ideally the FormTag class would extend from AbstractHtmlElementTag like most of the other tags, but this class in turn extends from AbstractDataBoundFormElementTag, which contains behavior that doesn't apply to the form tag. So I guess you might need to rework the inheritence hierarchy slightly?</p>
<p dir="auto">I don't need these attributes so as a temporary workaround I removed them from my spring-forms.tld.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0 M5</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398067031" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/6829" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/6829/hovercard" href="https://github.com/spring-projects/spring-framework/issues/6829">#6829</a> form:form tag does not support all documented attributes (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=drcgjung" rel="nofollow">Dr. Christoph G. Jung</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-2727?redirect=false" rel="nofollow">SPR-2727</a></strong> and commented</p>
<p dir="auto">I just stumbled over an issue when dealing with a reasonable Java5 feature, that is covariant method overrides.</p>
<p dir="auto">Suppose you define a general access interface</p>
<p dir="auto">public interface Foo {<br>
public Number getVersion();<br>
}</p>
<p dir="auto">and implement it in a bean like this (to my knowledge a really nice by-product of the lang spec extension that came with the introduction of Generics)</p>
<p dir="auto">public class Bar implements Foo {<br>
private double version;</p>
<p dir="auto">public Double getVersion() {<br>
return this.version;<br>
}</p>
<p dir="auto">public void setVersion(Double theDouble) {<br>
this.version=theDouble;<br>
}<br>
}</p>
<p dir="auto">the JavaBeans Introspector will upon reflecting Bar.class return a PropertyDescriptor for property "version" that has type "java.lang.Number", a read method java.lang.Number Bar.getVersion() and no write method! This leads to surprising NotWritablePropertyExceptions when trying to configure the Bar bean with Spring.</p>
<p dir="auto">The attached patch would lead to a CachedIntrospectionResults version that still is conformant to JavaBeans, but can deal with those covariant properties with a (AFAICS)<br>
minimal processing overhead (one additional "canonical" getter lookup per asymetric propertydescriptor, another one for identifying the corresponding setter).</p>
<p dir="auto">This would be really convenient and helpful (and I suppose there will be more such cases when dealing with generics in properties which can't be easily worked around by adding another getter/setter).</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0 final</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/12037/patch.txt" rel="nofollow">patch.txt</a> (<em>2.51 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398073256" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/7570" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/7570/hovercard" href="https://github.com/spring-projects/spring-framework/issues/7570">#7570</a> Data Binding to Class Extending Abstract Class Uses Volatile Abstract Methods Instead of Overridden Final Method (<em><strong>"is depended on by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398091650" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9928" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9928/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9928">#9928</a> The parameter type of the setter should not need to match the return type of the getter (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto">1 votes, 3 watchers</p>