This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

[%@ attribute name="class" required="false" %] causes failure  RSS feed

 
Matt Raible
author
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I use <%@ attribute name="class" required="false" %> in a JSP Tag file, it results in a blank page and the following error in my Tomcat console:



Any idea why? Change the attribute to "cssClass" works, but "class" is much more intuitive for web developers using my tag.

As a workaround, I can use dynamic-attributes. I'm just curious if this issue is documented anywhere or I'm just doing something wrong.

Thanks,

Matt
[ August 24, 2007: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66188
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect that Tomcat could be dealing with the problem a bit better, but using an attribute or property name of class is going to get you in all sorts of trouble with conflicts with the getClass() method of Object.

In similar situations, I've used styleClass, but cssClass should work as well.
[ August 24, 2007: Message edited by: Bear Bibeault ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!