[JAVAEETUTORIAL-117] incorrect en_US example instead of en-US and capitalized dir examples Created: 28/Jun/12  Updated: 27/Feb/13  Resolved: 27/Feb/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: 7.0.0

Type: Bug Priority: Major
Reporter: Brant Gurganus Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


This occurs in the "Table 7-4 Input Tag Attributes" table on http://docs.oracle.com/javaee/6/tutorial/doc/bnarf.html. HTML language codes are en-US, not en_US. This format is described at http://www.ietf.org/rfc/rfc1766.txt. Similarly, attributes are case sensitive in the XHTML world, so the dir attribute example values should be "ltr" and "rtl", not "LTR" and "RTL".

Comment by Kim Haase [ 09/Jul/12 ]

Actually, in Java the language codes do have underscores (see http://docs.oracle.com/javaee/6/tutorial/doc/bnaxv.html and the API documentation for the java.util.locale class). Underscores seem to be common on UNIX systems, while hyphens are used on Windows systems and in web browsers, but we're in the Java world here.

Also, the JSF input tag attributes do apparently take the attribute names in uppercase, according to the Facelets tag documentation at http://docs.oracle.com/javaee/6/javaserverfaces/2.1/docs/vdldocs/facelets/; see h:inputText, for example. Presumably this is converted to lowercase by the implementation.

Comment by Brant Gurganus [ 09/Jul/12 ]

I tested it out.
I put in a page:
<h:inputText lang="en_US"/>

This was in the output.
<input type="text" name="j_idt13" lang="en_US" />

It is correct from a JSF standpoint. JSF just puts the lang contents (after evaluation any EL expression) into the rendered lang attribute. So I can put lang="banana" in the JSF and get lang="banana" rendered even though that is clearly nonsense. It is not correct from an HTML standpoint where the valid language format comes from the RFC I mentioned. You can make up your own language tags, but those should be prefixed with an x- like x-gibberish.

Comment by Kim Haase [ 09/Jul/12 ]

I'll investigate this further. Thanks.

Comment by Ed Burns [ 27/Feb/13 ]

M jsf-api/doc/i18n-props.xml
M jsf-api/doc/standard-html-renderkit.xml

Direction indication for text that does not inherit directionality.
Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).
+ These attributes are case sensitive when rendering to XHTML, so
+ care must be taken to have the correct case.
Sending jsf-api/doc/i18n-props.xml
Sending jsf-api/doc/standard-html-renderkit.xml
Transmitting file data ..
Committed revision 11665.

Comment by Kim Haase [ 27/Feb/13 ]

Thanks very much again. Fixed in source.

Generated at Sat Nov 28 13:38:43 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.