1Z0-900 · Question #6
You have been asked to implement internationalization in your JSF web application. Where do you configure the supported locales?
The correct answer is A. in the <f:view> tag of the Facelet page. There appears to be an error in this answer key - the marked correct answer (A) is actually incorrect for this question. Supported locales in a JSF application are configured in faces-config.xml (option C), using the <locale-config> element nested inside <application>: ``xml…
Question
You have been asked to implement internationalization in your JSF web application. Where do you configure the supported locales?
Options
- Ain the <f:view> tag of the Facelet page
- Bin the web.xml file
- Cin the faces-config.xml file
- Din the src folder
How the community answered
(19 responses)- A89% (17)
- B5% (1)
- C5% (1)
Explanation
There appears to be an error in this answer key - the marked correct answer (A) is actually incorrect for this question. Supported locales in a JSF application are configured in faces-config.xml (option C), using the <locale-config> element nested inside <application>:
<application>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>fr</supported-locale>
<supported-locale>de</supported-locale>
</locale-config>
</application>
Why the distractors are wrong:
- A (
<f:view>) -<f:view locale="...">overrides the locale for a single page at runtime; it does not define which locales the application supports globally. - B (web.xml) -
web.xmlhandles servlet configuration (filters, listeners, context params), not JSF-specific i18n settings. - D (src folder) - A folder is not a configuration location; resource bundles live there but locale registration does not.
Memory tip: Think of faces-config.xml as the JSF application's "master settings" file - anything application-wide in JSF (navigation rules, managed beans in older versions, locale support) goes there, not in individual pages or the generic servlet descriptor.
Note for your exam prep: If this question appears verbatim on your exam with answer A marked correct, flag it - most authoritative JSF references (including the spec and Oracle docs) place
<locale-config>infaces-config.xml.
Topics
Community Discussion
No community discussion yet for this question.