[jboss-cvs] JBossAS SVN: r105551 - projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jun 2 01:23:45 EDT 2010


Author: misty at redhat.com
Date: 2010-06-02 01:23:44 -0400 (Wed, 02 Jun 2010)
New Revision: 105551

Modified:
   projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/I18n.xml
Log:
JBPAPP-4387

Modified: projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/I18n.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/I18n.xml	2010-06-02 05:16:44 UTC (rev 105550)
+++ projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/I18n.xml	2010-06-02 05:23:44 UTC (rev 105551)
@@ -24,13 +24,13 @@
 				You will need to configure the Tomcat connector to ensure that the application server receives the request parameters from client requests in the correct encoding. Add the <literal>URIEncoding="UTF-8"</literal> attribute to the connector configuration in <filename>$JBOSS_HOME/server/$PROFILE/deploy/jboss-web.deployer/server.xml</filename>:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<Connector port="8080" URIEncoding="UTF-8"/>]]>
+<programlisting language="XML" role="XML"><![CDATA[<Connector port="8080" URIEncoding="UTF-8"/>]]>
 </programlisting>
 			 <para>
 				Alternatively, you can tell JBoss AS that the correct encoding for the request parameters will be taken from the request:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<Connector port="8080" useBodyEncodingForURI="true"/>]]>
+<programlisting language="XML" role="XML"><![CDATA[<Connector port="8080" useBodyEncodingForURI="true"/>]]>
 </programlisting>
 		</section>
 		
@@ -49,9 +49,9 @@
 				Usage of this tool is described <ulink url="http://java.sun.com/j2se/1.5.0/docs/tooldocs/index.html#intl">here for Java 5</ulink> or <ulink url="http://java.sun.com/javase/6/docs/technotes/tools/#intl">here for Java 6</ulink>. For example, to convert a file from UTF-8:
 			</para>
 			 
-<programlisting><prompt>
-$ native2ascii -encoding UTF-8 messages_cs.properties > messages_cs_escaped.properties</prompt>
-</programlisting>
+<command>
+$ native2ascii -encoding UTF-8 messages_cs.properties > messages_cs_escaped.properties
+</command>
 		</section>
 		
 		 <section>
@@ -66,7 +66,7 @@
 				JSF/Facelets should submit any requests with the specified character encoding, but to ensure that requests that do not specify an encoding are submitted, you can force the request encoding using a servlet filter. Configure this in <filename>components.xml</filename>:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<web:character-encoding-filter encoding="UTF-8" override-client="true" 
+<programlisting language="XML" role="XML"><![CDATA[<web:character-encoding-filter encoding="UTF-8" override-client="true" 
      url-pattern="*.seam" />]]>
 </programlisting>
 		</section>
@@ -102,7 +102,7 @@
 			It is useful to allow the user to set the locale manually via the application user interface. Seam provides built-in functionality to override the locale determined by the default algorithm. Do this by adding the following fragment to a form in your JSP or Facelets page:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<h:selectOneMenu value="#{localeSelector.language}"> 
+<programlisting language="XML" role="XML"><![CDATA[<h:selectOneMenu value="#{localeSelector.language}"> 
   <f:selectItem itemLabel="English" itemValue="en"/> 
   <f:selectItem itemLabel="Deutsch" itemValue="de"/> 
   <f:selectItem itemLabel="Francais" itemValue="fr"/> 
@@ -114,7 +114,7 @@
 			Or, if you want a list of all supported locales from <filename>faces-config.xml</filename>, use:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<h:selectOneMenu value="#{localeSelector.localeString}"> 
+<programlisting language="XML" role="XML"><![CDATA[<h:selectOneMenu value="#{localeSelector.localeString}"> 
   <f:selectItems value="#{localeSelector.supportedLocales}"/> 
 </h:selectOneMenu> 
 <h:commandButton action="#{localeSelector.select}" 
@@ -127,7 +127,7 @@
 			You can configure the supported locales and the default locale of the server with the built-in <literal>org.jboss.seam.international.localeConfig</literal> component. First, declare an XML namespace for Seam's international package in the Seam component descriptor. Then, define the default locale and supported locales as follows:
 		</para>
 		 
-<programlisting role="XML"><![CDATA[<international:locale-config default-locale="fr_CA" 
+<programlisting language="XML" role="XML"><![CDATA[<international:locale-config default-locale="fr_CA" 
                supported-locales="en fr_CA fr_FR"/>]]>
 </programlisting>
 		 <para>
@@ -149,19 +149,19 @@
 				So, in <filename>messages_en.properties</filename>:
 			</para>
 			 
-<programlisting>Hello=Hello
-</programlisting>
+<screen>Hello=Hello</screen>
+
 			 <para>
 				And in <filename>messages_en_AU.properties</filename>:
 			</para>
 			 
-<programlisting>Hello=G'day
-</programlisting>
+<screen>Hello=G'day</screen>
+
 			 <para>
 				You can select a different name for the resource bundle by setting the Seam configuration property named <literal>org.jboss.seam.core.resourceLoader.bundleNames</literal>. You can even specify a list of resource bundle names to be searched (depth first) for messages.
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<core:resource-loader> 
+<programlisting language="XML" role="XML"><![CDATA[<core:resource-loader> 
   <core:bundle-names> 
     <value>mycompany_messages</value> 
     <value>standard_messages</value>       
@@ -175,7 +175,7 @@
 				You can even specify an explicit bundle name in <filename> pages.xml</filename>:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<page view-id="/welcome/hello.jsp" bundle="HelloMessages"/>]]>
+<programlisting language="XML" role="XML"><![CDATA[<page view-id="/welcome/hello.jsp" bundle="HelloMessages"/>]]>
 </programlisting>
 			 <para>
 				Then we could use messages defined in <filename>HelloMessages.properties</filename> on <filename>/welcome/hello.jsp</filename>.
@@ -188,32 +188,28 @@
 				If you define your labels with the Seam resource bundle, you can use them without having to type <literal><![CDATA[<f:loadBundle... />]]></literal> on each page. Instead, you can type:
 			</para>
 			 
-<programlisting role="XHTML"><![CDATA[<h:outputText value="#{messages['Hello']}"/>]]>
+<programlisting language="XML" role="XML"><![CDATA[<h:outputText value="#{messages['Hello']}"/>]]>
 </programlisting>
 			 <para>
 				or:
 			</para>
 			 
-<programlisting role="XHTML"><![CDATA[<h:outputText value="#{messages.Hello}"/>]]>
+<programlisting language="XML" role="XML"><![CDATA[<h:outputText value="#{messages.Hello}"/>]]>
 </programlisting>
 			 <para>
 				Even better, the messages themselves may contain EL expressions:
 			</para>
 			 
-<programlisting>Hello=Hello, #{user.firstName} #{user.lastName}
-</programlisting>
+<screen>Hello=Hello, #{user.firstName} #{user.lastName}</screen>
 			 
-<programlisting>Hello=G'day, #{user.firstName}
-</programlisting>
+<screen>Hello=G'day, #{user.firstName}</screen>
 			 <para>
 				You can even use the messages in your code:
 			</para>
 			 
-<programlisting role="JAVA"><![CDATA[@In private Map<String, String> messages;]]>
-</programlisting>
+<programlisting language="Java" role="JAVA">@In private Map&lt;String, String&gt; messages; </programlisting>
 			 
-<programlisting role="JAVA"><![CDATA[@In("#{messages['Hello']}") private String helloMessage;]]>
-</programlisting>
+<programlisting language="Java" role="JAVA">@In("#{messages['Hello']}") private String helloMessage;</programlisting>
 		</section>
 		
 		 <section>
@@ -222,14 +218,14 @@
 				The <literal>facesMessages</literal> component is a convenient way to display success or failure messages to the user. The functionality we just described also works for Faces messages:
 			</para>
 			 
-<programlisting role="JAVA"><![CDATA[@Name("hello") 
+<programlisting language="Java" role="JAVA">@Name("hello") 
 @Stateless 
 public class HelloBean implements Hello { 
   @In FacesMessages facesMessages; 
   public String sayIt() { 
     facesMessages.addFromResourceBundle("Hello"); 
   } 
-}]]>
+}
 </programlisting>
 			 <para>
 				This will display <literal>Hello, Gavin King</literal> or <literal>G'day, Gavin</literal>, depending upon the user's locale.
@@ -260,7 +256,7 @@
 			First, configure the set of supported themes:
 		</para>
 		 
-<programlisting role="XML"><![CDATA[<theme:theme-selector cookie-enabled="true">
+<programlisting language="XML" role="XML"><![CDATA[<theme:theme-selector cookie-enabled="true">
   <theme:available-themes>
     <value>default</value>
     <value>accessible</value>
@@ -275,9 +271,9 @@
 			Themes are defined in a properties file with the same name as the theme. For example, the <literal>default</literal> theme is defined as a set of entries in <filename> default.properties</filename>, which might define:
 		</para>
 		 
-<programlisting>
+<screen>
 css ../screen.css template /template.xhtml
-</programlisting>
+</screen>
 		 <para>
 			The entries in a theme resource bundle are usually paths to CSS styles or images and names of Facelets templates (unlike localization resource bundles which are usually text).
 		</para>
@@ -285,20 +281,20 @@
 			Now we can use these entries in our JSP or Facelets pages. For example, to theme the stylesheet in a Facelets page:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<link href="#{theme.css}" rel="stylesheet" type="text/css" />]]>
+<programlisting language="XML" role="XML"><![CDATA[<link href="#{theme.css}" rel="stylesheet" type="text/css" />]]>
 </programlisting>
 		 <para>
 			Or, where the page definition resides in a subdirectory:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<link href="#{facesContext.externalContext.requestContextPath}#{theme.css}" 
+<programlisting language="XML" role="XML"><![CDATA[<link href="#{facesContext.externalContext.requestContextPath}#{theme.css}" 
       rel="stylesheet" type="text/css" />]]>
 </programlisting>
 		 <para>
 			Most powerfully, Facelets lets us theme the template used by a <literal><![CDATA[<ui:composition>]]></literal>:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+<programlisting language="XML" role="XML"><![CDATA[<ui:composition xmlns="http://www.w3.org/1999/xhtml"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
@@ -308,7 +304,7 @@
 			Just like the locale selector, there is a built-in theme selector to allow the user to freely switch themes:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<h:selectOneMenu value="#{themeSelector.theme}"> 
+<programlisting language="XML" role="XML"><![CDATA[<h:selectOneMenu value="#{themeSelector.theme}"> 
   <f:selectItems value="#{themeSelector.themes}"/> 
 </h:selectOneMenu> 
 <h:commandButton action="#{themeSelector.select}" value="Select Theme"/>]]>
@@ -321,7 +317,7 @@
 			The locale selector, theme selector and timezone selector all support persistence of locale and theme preference to a cookie. Simply set the <literal>cookie-enabled</literal> property in <filename>components.xml</filename>:
 		</para>
 		 
-<programlisting role="XML"><![CDATA[<theme:theme-selector cookie-enabled="true">
+<programlisting language="XML" role="XML"><![CDATA[<theme:theme-selector cookie-enabled="true">
   <theme:available-themes>
     <value>default</value>
     <value>accessible</value>




More information about the jboss-cvs-commits mailing list