[ 
https://issues.apache.org/jira/browse/WW-4166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13727699#comment-13727699
 ] 

Eric Lentz commented on WW-4166:
--------------------------------

What I would propose herein is kind of a hack, but IMO so is cssClass, which 
affects lots of people versus a little coding magic in the framework which 
impacts far fewer. So Paul, if that is an issue, (and you've probably thought 
of this) my suggestion would be to use some kind of an alias field in the code 
when you need a get/set on class? You could potentially even reuse the cssClass 
field as there should never be a cssClass attribute at the same time as a class 
attribute?

How it is stored in memory is not terribly important except for framework code 
cleanliness. We're probably talking about two if conditions to check for 
"class" on the way into (set) and out of (get) an object. There is probably 
some kind of generic mechanism for reading the tag attributes? Hopefully, there 
would be a decent place to insert these two if conditions if it is necessary at 
all.

By the way, and not to be greedy, but if this does get into the framework, why 
not also allow "style" while someone is in there making this change?
                
> Allow "class" attribute on Struts tags
> --------------------------------------
>
>                 Key: WW-4166
>                 URL: https://issues.apache.org/jira/browse/WW-4166
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Eric Lentz
>            Priority: Trivial
>             Fix For: 2.3.17
>
>
> In building a JSP, and working on web related things outside of the Java 
> environment, there are lots of tags which all receive the "class" attribute. 
> The Struts developer must _remember_ to call the attribute cssClass instead. 
> Typing muscle memory drives me to half of the time typing "class" instead, 
> which leads to HTML which reads, 'class="class java.util.HashMap"'
> Why not just allow "class" like the rest of the HTML world? Why do we need to 
> be different? I have a billion things to remember when web developing, this 
> shouldn't be one of them.
> We don't even have to to deprecate or obsolete cssClass, just also allow 
> "class"... please!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to