Java: attributes order in .jsp getting inversed
Posted
by NoozNooz42
on Stack Overflow
See other posts from Stack Overflow
or by NoozNooz42
Published on 2010-05-31T23:45:46Z
Indexed on
2010/06/01
2:13 UTC
Read the original article
Hit count: 358
Every single time I've read about the meta tags, the attribute where in this order for the description:
<meta name="description" content="..." />
First name, then content. It's also like that in the Google Webmaster documentation. Basically, it's like that everywhere.
Now in a .jsp (in XML notation) I've got the following:
<meta name="description" content="${metadesc}"/>
So it's name first, then content.
Yet on the generated webpage, I get this:
<meta content="...(200 chars or so here making it a very long line)..." name="description"/>
Somehow the attributes have been inversed. Because the content follows the official W3C and Google recommendations, the content is a bit less than 200 characters long, which makes it a major pain to "visually verify" that the name attribute is correctly there (I've got to scroll).
Anyway...
Why are these attribute not appearing in the order defined in the .jsp?
Can I force them to appear in the same order as I wrote them in my .jsp?
I realize the resulting tag may be valid... But I can also imagine a lot of very creative ways to have valid tags which users would be very upset about. Does this make any sense to inverse these attributes?
EDIT wow, just wow... If I invert the attributes in my .jsp (that is, writing them in the "wrong" order), then they appear as I want them to appear in the generated web page. (Tomcat 6.0.26 btw)
© Stack Overflow or respective owner