Spring invalid dynamic attributes when updating to Java 7

I am in charge of a quite old website who was at first compiling with Java 5 and now Java 6. I'm using Spring 3.1.

I'm trying to update from Java 6/ Tomcat 6 to Java 7 / Tomcat 7 and I have a lot of problems regarding the form tags.

For this code:

<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>    
...
<form:textarea path="myPath" placeholder="hello world" id="myId" rows="1" />

I get that error:

Attribute placeholder invalid for tag textarea according to TLD

It seems that a lot of the attributes I was using before updating Java don't work anymore. Do you have any idea why? Thanks!

Answers


It looks like the WAR contains accidentally several versions of the TLD, and in Tomcat 6 the correct version is found, but on Tomcat 7 the wrong version is loaded instead.

If two different versions of the same jar are present in WEB-INF/lib, there is no way to predict which one will be chosen, the results are dependent on the classloader implementation details, and so different Tomcat versions might yield different results.

To verify this, try looking in your IDE by the multiple versions of file spring.schemas. These files contain the mapping between url's such as http://www.springframework.org/tags/form and the XSDs /TLDs shipped inside the same jar.

This mechanism exists for XSDs/TLDs that are not published online such as the url of this case, if you paste the url to a browser the file does not exist.

In this case there should be two spring.schemas both with mention to url http://www.springframework.org/tags/form. Remove the one with the wrong version of the XSD/TLD and it should work correctly in both Tomcat versions.


Need Your Help

Adding elements to a panel in c#!

c# wpf hide panel elements

quick question, in a c# Windows Presentation Foundation How can i add some elements to a Panel so i can easily hide all the elements (Text, Labels...) by just hiding the panel it self?

Spec testing EventMachine-based (Reactor) Code

ruby testing amqp eventmachine minitest

I'm trying out the whole BDD approach and would like to test the AMQP-based aspect of a vanilla Ruby application I am writing. After choosing Minitest as the test framework for its balance of featu...