formsspringdynamic-attributes

Unable to add a dynamic attribute to a Spring form:input tag


I have a Spring form tag and am trying to add a dynamic attribute (the "placeholder" attribute), but get the following error

org.apache.jasper.JasperException: /WEB-INF/jsp/work.jsp (line: 290, column: 3) 
Attribute placeholder invalid for tag textarea according to TLD

The jsp:

<form:input path="name" cssClass="input-xlarge" id="name" placeholder="type your name"/>

According to: https://jira.springsource.org/browse/SPR-5931 dynamic attributes are supported in Spring 3.0 (depending on JSP 2.0) which I belive I have.

My environment:

Java: 1.6.0_29
Tomcat: Apache Tomcat/7.0.25
Servlet: 3.0
Spring : 3.0.7.RELEASE
JSP Engine: 2.1

Solution

  • I discovered that even though I am using Spring version 3.0*, my form taglib was from verison 2.0 becauswas spring-2.0-m5.jar was in my lib folder. When I removed it, the form tag rendered with the "placeholder" attribute).

    *the following code reported the Spring version to 3.0.7.RELEASE : org.springframework.core.SpringVersion.getVersion( )