• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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

 
author
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic