Our team is migrating from Web Logic 12 to Tomcat 9; we are noticing that our custom JSP tags are having issues with attributes. The attributes are not properly cased (e.g. "myattribute" vs. "myAttribute"). This causes JSP compile errors in Tomcat 9, but not Web Logic 12. I cannot share the exact code, but the following is the same pattern as what we are encountering.
Is there a setting in Tomcat that allows for the JSP engine to allow for custom tag attributes to be case insensitive?
Tag Library
<tag>
<name>myTag</name>
<tagclass>com.foo.MyTag</tagclass>
<bodycontent>JSP</bodycontent>
<info> This Tag defines a form.</info>
<attribute>
<name>myVar</name>
<required>false</required>
</attribute>
</tag>
Class
public class MyTag {
private String myVar = "";
public void setMyVar(String myVar) {
this.myVar = myVar;
}
public String getMyVar()
{
return this.myVar;
}
}
JSP
<customTag:myTag myvar="bar"/>
Error Message (or similar to)
org.apache.jasper.JasperException: /jsp/mypage.jsp
(line: [###], column: [0])
Attribute [myvar] invalid for tag [myTag] according to TLD
Tag attribute is case-sensitive, as Java variable
Tag attributes must be declared inside the tag element by means of an attribute element. The attribute element has three nested elements that can appear between and .
name. This is a required element that defines the case-sensitive attribute name.