[richfaces-svn-commits] JBoss Rich Faces SVN: r2232 - in trunk: ui/insert/src/main/java/org/richfaces/ui/component and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Aug 13 16:08:41 EDT 2007


Author: alexsmirnov
Date: 2007-08-13 16:08:41 -0400 (Mon, 13 Aug 2007)
New Revision: 2232

Modified:
   trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToXHTMLStream.java
   trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java
Log:
Force NEKO parser to escape <, >, & characters in the attributes
Throw exceptions in the <rich:insert> component if target resource can't be found.

Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToXHTMLStream.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToXHTMLStream.java	2007-08-13 19:30:09 UTC (rev 2231)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToXHTMLStream.java	2007-08-13 20:08:41 UTC (rev 2232)
@@ -1422,15 +1422,15 @@
             {
                 cleanLength++;
             }
-            else if ('<' == ch || '>' == ch)
-            {
-                cleanLength++; // no escaping in this case, as specified in 15.2
-            }
-            else if (
-                ('&' == ch) && ((i + 1) < end) && ('{' == chars[i + 1]))
-            {
-                cleanLength++; // no escaping in this case, as specified in 15.2
-            }
+//            else if ('<' == ch || '>' == ch)
+//            {
+//                cleanLength++; // no escaping in this case, as specified in 15.2
+//            }
+//            else if (
+//                ('&' == ch) && ((i + 1) < end) && ('{' == chars[i + 1]))
+//            {
+//                cleanLength++; // no escaping in this case, as specified in 15.2
+//            }
             else
             {
                 if (cleanLength > 0)

Modified: trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java
===================================================================
--- trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java	2007-08-13 19:30:09 UTC (rev 2231)
+++ trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java	2007-08-13 20:08:41 UTC (rev 2232)
@@ -67,7 +67,11 @@
 						content = out.toString();
 					}
 				}
+			} else {
+				throw new FacesException("Resource '"+getSrc()+"' for a component <rich:insert > "+getClientId(getFacesContext())+" not found");				
 			}
+		} else {
+			throw new FacesException("Attribute 'scr' for a component <rich:insert > "+getClientId(getFacesContext())+" must be set");
 		}
 
 		return content;




More information about the richfaces-svn-commits mailing list