[jboss-cvs] JBossAS SVN: r105619 - 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
Thu Jun 3 02:47:47 EDT 2010


Author: misty at redhat.com
Date: 2010-06-03 02:47:46 -0400 (Thu, 03 Jun 2010)
New Revision: 105619

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

Modified: projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Validation.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Validation.xml	2010-06-03 06:42:24 UTC (rev 105618)
+++ projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Validation.xml	2010-06-03 06:47:46 UTC (rev 105619)
@@ -8,7 +8,7 @@
 		In plain JSF, validation is defined in the view:
 	</para>
 	 
-<programlisting role="XHTML"><![CDATA[<h:form>
+<programlisting language="XML" role="XML"><![CDATA[<h:form>
   <h:messages/>
 
   <div>
@@ -35,7 +35,7 @@
 		We will begin by defining our constraints, on our <literal>Location</literal> class:
 	</para>
 	 
-<programlisting role="JAVA"><![CDATA[public class Location {
+<programlisting language="Java" role="JAVA">public class Location {
   private String country;
   private String zip;
   
@@ -49,13 +49,13 @@
   @Pattern("^\d*$")
   public String getZip() { return zip; }
   public void setZip(String z) { zip = z; }
-}]]>
+}
 </programlisting>
 	 <para>
 		In practice, it may be more elegant to use custom constraints rather than those built into Hibernate Validator:
 	</para>
 	 
-<programlisting role="JAVA"><![CDATA[public class Location {
+<programlisting language="Java" role="JAVA">public class Location {
   private String country;
   private String zip;
   
@@ -68,13 +68,13 @@
   @ZipCode
   public String getZip() { return zip; }
   public void setZip(String z) { zip = z; }
-}]]>
+}
 </programlisting>
 	 <para>
 		Whichever method we choose, we no longer need specify the validation type to be used in the JSF page. Instead, we use <literal><![CDATA[<s:validate>]]></literal> to validate against the constraint defined on the model object.
 	</para>
 	 
-<programlisting role="XHTML"><![CDATA[<h:form>
+<programlisting language="XML" role="XML"><![CDATA[<h:form>
   <h:messages/>
 
   <div>
@@ -107,7 +107,7 @@
 		The design is better, but not much less verbose than our initial design. Now, we will use <literal><![CDATA[<s:validateAll>]]></literal>:
 	</para>
 	 
-<programlisting role="XHTML"><![CDATA[<h:form>
+<programlisting language="XML" role="XML"><![CDATA[<h:form>
     
   <h:messages/>
 
@@ -136,7 +136,7 @@
 		Next, we need to display feedback to the user when validation fails. Currently, all messages are displayed at the top of the form. To correlate the message with an input, you must define a label by using the standard <literal>label</literal> attribute on the input component.
 	</para>
 	 
-<programlisting role="XHTML"><![CDATA[<h:inputText value="#{location.zip}" required="true" label="Zip:"> 
+<programlisting language="XML" role="XML"><![CDATA[<h:inputText value="#{location.zip}" required="true" label="Zip:"> 
   <s:validate/> 
 </h:inputText>]]>
 </programlisting>
@@ -153,7 +153,7 @@
 		This is a lot of functionality for each field. We do not want to specify highlighting and the layout of the image, message, and input field for every field on the form, so we specify the layout in a facelets template:
 	</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"
@@ -182,7 +182,7 @@
 		We can include this template for each of our form fields by using <literal><![CDATA[<s:decorate>]]></literal>:
 	</para>
 	 
-<programlisting role="XHTML"><![CDATA[<h:form>
+<programlisting language="XML" role="XML"><![CDATA[<h:form>
   <h:messages globalOnly="true"/>
 
     <s:decorate template="edit.xhtml">
@@ -203,7 +203,7 @@
 		Finally, we can use RichFaces Ajax to display validation messages while the user navigates around the form:
 	</para>
 	 
-<programlisting role="XHTML"><![CDATA[<h:form>
+<programlisting language="XML" role="XML"><![CDATA[<h:form>
   <h:messages globalOnly="true"/>
 
     <s:decorate id="countryDecoration" template="edit.xhtml">
@@ -230,7 +230,7 @@
 		Stylistically, it is better to define explicit IDs for important page controls, particularly if you want automated UI testing. If explicit IDs are not provided, JSF will generate its own — but they will not remain static if anything on the page is changed.
 	</para>
 	 
-<programlisting role="XHTML"><![CDATA[<h:form id="form">
+<programlisting language="XML" role="XML"><![CDATA[<h:form id="form">
   <h:messages globalOnly="true"/>
 
     <s:decorate id="countryDecoration" template="edit.xhtml">
@@ -258,7 +258,7 @@
 		If you want to specify a different message to be displayed when validation fails, you can use the Seam message bundle with the Hibernate Validator:
 	</para>
 	 
-<programlisting role="JAVA"><![CDATA[public class Location {
+<programlisting language="Java" role="JAVA">public class Location {
   private String name;
   private String zip;
   
@@ -269,10 +269,10 @@
   @ZipCode(message="#{messages['location.zipCode.invalid']}")
   public String getZip() { return zip; }
   public void setZip(String z) { zip = z; }
-}]]>
+}
 </programlisting>
 	 
-<programlisting> location.zipCode.invalid = The zip code is not valid for #{location.name}
-</programlisting>
+<screen> location.zipCode.invalid = The zip code is not valid for #{location.name}
+</screen>
 </chapter>
 




More information about the jboss-cvs-commits mailing list