Issue Details (XML | Word | Printable)

Key: JAVAEETUTORIAL-117
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Kim Haase
Reporter: Brant Gurganus
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
javaeetutorial

incorrect en_US example instead of en-US and capitalized dir examples

Created: 28/Jun/12 03:26 AM   Updated: 27/Feb/13 09:23 PM   Resolved: 27/Feb/13 09:23 PM
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: 7.0.0

Time Tracking:
Not Specified

Tags:
Participants: Brant Gurganus, Ed Burns and Kim Haase


 Description  « Hide

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".



Kim Haase added a comment - 09/Jul/12 04:22 PM

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.


Brant Gurganus added a comment - 09/Jul/12 05:30 PM

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.


Kim Haase added a comment - 09/Jul/12 07:07 PM

I'll investigate this further. Thanks.


Ed Burns added a comment - 27/Feb/13 08:40 PM

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

<description>
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.
</description>
Sending jsf-api/doc/i18n-props.xml
Sending jsf-api/doc/standard-html-renderkit.xml
Transmitting file data ..
Committed revision 11665.


Kim Haase added a comment - 27/Feb/13 09:23 PM

Thanks very much again. Fixed in source.