JBoss Rich Faces SVN: r19083 - trunk/core/impl/src/test/java/org/richfaces/resource.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-09-01 12:01:31 -0400 (Wed, 01 Sep 2010)
New Revision: 19083
Modified:
trunk/core/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java
Log:
https://jira.jboss.org/browse/RF-9288
Modified: trunk/core/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java
===================================================================
--- trunk/core/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java 2010-09-01 15:38:44 UTC (rev 19082)
+++ trunk/core/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java 2010-09-01 16:01:31 UTC (rev 19083)
@@ -43,6 +43,8 @@
import org.easymock.classextension.EasyMock;
import org.jboss.test.faces.AbstractFacesTest;
import org.jboss.test.faces.htmlunit.LocalWebClient;
+import org.richfaces.application.DependencyInjectionServiceImpl;
+import org.richfaces.application.DependencyInjector;
import org.richfaces.application.Module;
import org.richfaces.application.ServiceTracker;
import org.richfaces.application.ServicesFactory;
@@ -247,6 +249,7 @@
injector.setInstance(ResourceCodec.class,mockedCodec);
injector.setInstance(org.ajax4jsf.cache.Cache.class,mockCache);
injector.setInstance(Uptime.class, new Uptime());
+ injector.setInstance(DependencyInjector.class, new DependencyInjectionServiceImpl());
}
}));
14 years, 3 months
JBoss Rich Faces SVN: r19082 - trunk/examples/core-demo/src/main/webapp.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-09-01 11:38:44 -0400 (Wed, 01 Sep 2010)
New Revision: 19082
Modified:
trunk/examples/core-demo/src/main/webapp/ajax.xhtml
Log:
* fixed label of the last input
Modified: trunk/examples/core-demo/src/main/webapp/ajax.xhtml
===================================================================
--- trunk/examples/core-demo/src/main/webapp/ajax.xhtml 2010-09-01 15:29:06 UTC (rev 19081)
+++ trunk/examples/core-demo/src/main/webapp/ajax.xhtml 2010-09-01 15:38:44 UTC (rev 19082)
@@ -88,7 +88,7 @@
<a:ajax bypassUpdates="true" />
</h:commandLink>
- bypassUpdates="#{true}"
+ bypassUpdates="#{'#'}{true}"
<h:inputText>
<a:ajax bypassUpdates="#{true}" event="keyup" />
</h:inputText>
14 years, 3 months
JBoss Rich Faces SVN: r19081 - trunk/core/impl/src/main/java/org/ajax4jsf/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-09-01 11:29:06 -0400 (Wed, 01 Sep 2010)
New Revision: 19081
Modified:
trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
Log:
https://jira.jboss.org/browse/RF-9269
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2010-09-01 15:12:29 UTC (rev 19080)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2010-09-01 15:29:06 UTC (rev 19081)
@@ -57,6 +57,8 @@
import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
+import com.google.common.base.Strings;
+
/**
* @author shura
* <p/>
@@ -680,6 +682,10 @@
String[] values = asArray(areasString);
Set<String> result = new LinkedHashSet<String>(values.length);
for (String value : values) {
+ if (Strings.isNullOrEmpty(value)) {
+ continue;
+ }
+
result.add(value);
}
@@ -687,7 +693,9 @@
} else {
Set<String> areasSet = new LinkedHashSet<String>(5);
- areasSet.add(areasString);
+ if (!Strings.isNullOrEmpty(areasString)) {
+ areasSet.add(areasString);
+ }
return areasSet;
}
14 years, 3 months
JBoss Rich Faces SVN: r19080 - trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/taglib.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-09-01 11:12:29 -0400 (Wed, 01 Sep 2010)
New Revision: 19080
Modified:
trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java
Log:
https://jira.jboss.org/browse/RF-9283
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java 2010-09-01 15:08:01 UTC (rev 19079)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java 2010-09-01 15:12:29 UTC (rev 19080)
@@ -214,10 +214,10 @@
Element attr = tag.addElement("attribute");
addDescription(attr, attribute);
attr.addElement("name").addText(name);
- attr.addElement("type").addText(attribute.getType().getName());
if (attribute.isRequired()) {
attr.addElement("required").addText("true");
}
+ attr.addElement("type").addText(attribute.getType().getName());
return attr;
}
14 years, 3 months
JBoss Rich Faces SVN: r19079 - in branches/RF-7560/core/api/src: test/java/org/ajax4jsf/javascript and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-09-01 11:08:01 -0400 (Wed, 01 Sep 2010)
New Revision: 19079
Modified:
branches/RF-7560/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java
branches/RF-7560/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java
Log:
Reverted changes from r19075
Modified: branches/RF-7560/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java
===================================================================
--- branches/RF-7560/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java 2010-09-01 15:03:14 UTC (rev 19078)
+++ branches/RF-7560/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java 2010-09-01 15:08:01 UTC (rev 19079)
@@ -31,14 +31,13 @@
// private char APOSTROPHE[] = { '\\', '\'' };
private static final char[] ENCODE_HEX = "0123456789ABCDEF".toCharArray();
+ private static final char[] ENCODE_APOS = "\\'".toCharArray();
private static final char[] ENCODE_QUOT = "\\\"".toCharArray();
private static final char[] ENCODE_LF = "\\n".toCharArray();
- private static final char[] ENCODE_BC = "\\b".toCharArray();
private static final char[] ENCODE_FF = "\\f".toCharArray();
private static final char[] ENCODE_CR = "\\r".toCharArray();
private static final char[] ENCODE_TAB = "\\t".toCharArray();
private static final char[] ENCODE_BS = "\\\\".toCharArray();
- private static final char[] ENCODE_FS = "\\/".toCharArray();
// private static final char ENCODE_ESC[] = "\\e".toCharArray();
@@ -48,34 +47,32 @@
public JSEncoder() {}
/**
- * Return true or false whether this encoding/format can encode the specified
+ * Return true or false wether this encoding can encode the specified
* character or not.
* <p>
* This method will return true for the following character range: <br />
* <code>
- * <nobr>\b | \f | \t | \r | \n | " | \ | / | [#x20-#xD7FF] | [#xE000-#xFFFD]</nobr>
+ * <nobr>#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]</nobr>
* </code>
* </p>
*
* @see <a href="http://www.w3.org/TR/REC-xml#charsets">W3C XML 1.0 </a>
- * @see <a href="http://json.org/">JSON.org</a>
*/
public boolean compile(char c) {
- if ((c == '\b') ||
- (c == '\f') |
- (c == '\t') ||
- (c == '\n') ||
- (c == '\r') ||
- (c == '"') ||
- (c == '\\') ||
- (c == '/') ||
- (c == ']') || // ] - to avoid conflicts in CDATA
- (c == '<') || // - escape HTML markup characters
- (c == '>') || // - HTML
- (c == '&') || // - HTML
- (c == '-') || // - HTML comments
- (c < 0x20) || // See <http://www.w3.org/TR/REC-xml#charsets>
- ((c > 0xd7ff) && (c < 0xe000)) || (c > 0xfffd) || (c > 0xff)) {
+ if ((c == 0x09) || // [\t]
+ (c == 0x0a) || // [\n]
+ (c == 0x0d) || // [\r](c == 0x22) || // ["]
+ (c == 0x22) || // ["]
+ (c == 0x27) || // [']
+ (c == 0x5c) || // [\]
+ (c == 0x03) || // [esc]
+ (c == ']') || // ] - to avoid conflicts in CDATA
+ (c == '<') || // - escape HTML markup characters
+ (c == '>') || // - HTML
+ (c == '&') || // - HTML
+ (c == '-') || // - HTML comments
+ (c < 0x20) || // See <http://www.w3.org/TR/REC-xml#charsets>
+ ((c > 0xd7ff) && (c < 0xe000)) || (c > 0xfffd) || (c > 0xff)) {
return false;
}
@@ -88,36 +85,39 @@
*/
public char[] encode(char c) {
switch (c) {
- case '\b' :
- return ENCODE_BC;
-
- case '\f' :
- return ENCODE_FF;
+ case 0x03 :
+ return ENCODE_FF; // (>) [>]
- case '\t' :
- return ENCODE_TAB;
+ case 0x09 :
+ return ENCODE_TAB; // (>) [>]
- case '\n' :
- return ENCODE_LF;
+ case 0x0a :
+ return ENCODE_LF; // (>) [>]
- case '\r' :
- return ENCODE_CR;
+ case 0x0d :
+ return ENCODE_CR; // (>) [>]
- case '"' :
- return ENCODE_QUOT;
+ case 0x22 :
+ return ENCODE_QUOT; // (") ["]
- case '\\' :
- return ENCODE_BS;
+ case 0x27 :
+ return ENCODE_APOS; // (') [']
- case '/' :
- return ENCODE_FS;
-
+ case 0x5c :
+ return ENCODE_BS; // (<) [<]
+
default : {
- char[] ret = {
- '\\', 'u', ENCODE_HEX[c >> 0xc & 0xf], ENCODE_HEX[c >> 0x8 & 0xf], ENCODE_HEX[c >> 0x4 & 0xf],
- ENCODE_HEX[c & 0xf]
- };
+ if (c > 0xff) {
+ char[] ret = {
+ '\\', 'u', ENCODE_HEX[c >> 0xc & 0xf], ENCODE_HEX[c >> 0x8 & 0xf], ENCODE_HEX[c >> 0x4 & 0xf],
+ ENCODE_HEX[c & 0xf]
+ };
+ return ret;
+ }
+
+ char[] ret = {'\\', 'x', ENCODE_HEX[c >> 0x4 & 0xf], ENCODE_HEX[c & 0xf]};
+
return ret;
}
}
Modified: branches/RF-7560/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java
===================================================================
--- branches/RF-7560/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java 2010-09-01 15:03:14 UTC (rev 19078)
+++ branches/RF-7560/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java 2010-09-01 15:08:01 UTC (rev 19079)
@@ -123,9 +123,9 @@
* Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
*/
public void testStringToScript() {
- Object obj = "f \b\r\t\f\n\"'\\/ oo";
+ Object obj = "foo";
- assertEquals("\"f \\b\\r\\t\\f\\n\\\"'\\\\\\/ oo\"", ScriptUtils.toScript(obj));
+ assertEquals("\"foo\"", ScriptUtils.toScript(obj));
}
/**
@@ -260,8 +260,8 @@
public void testAddEncoded() {
StringBuilder buff = new StringBuilder();
- ScriptUtils.addEncoded(buff, "foo");
- assertEquals("foo", buff.toString());
+ ScriptUtils.addEncoded(buff, "foo\"\'");
+ assertEquals("foo\\\"\\\'", buff.toString());
}
/**
14 years, 3 months
JBoss Rich Faces SVN: r19078 - in trunk/core/api/src: test/java/org/ajax4jsf/javascript and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-09-01 11:03:14 -0400 (Wed, 01 Sep 2010)
New Revision: 19078
Modified:
trunk/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java
trunk/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java
Log:
RF-9075
Modified: trunk/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java
===================================================================
--- trunk/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java 2010-09-01 14:58:06 UTC (rev 19077)
+++ trunk/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java 2010-09-01 15:03:14 UTC (rev 19078)
@@ -31,13 +31,14 @@
// private char APOSTROPHE[] = { '\\', '\'' };
private static final char[] ENCODE_HEX = "0123456789ABCDEF".toCharArray();
- private static final char[] ENCODE_APOS = "\\'".toCharArray();
private static final char[] ENCODE_QUOT = "\\\"".toCharArray();
private static final char[] ENCODE_LF = "\\n".toCharArray();
+ private static final char[] ENCODE_BC = "\\b".toCharArray();
private static final char[] ENCODE_FF = "\\f".toCharArray();
private static final char[] ENCODE_CR = "\\r".toCharArray();
private static final char[] ENCODE_TAB = "\\t".toCharArray();
private static final char[] ENCODE_BS = "\\\\".toCharArray();
+ private static final char[] ENCODE_FS = "\\/".toCharArray();
// private static final char ENCODE_ESC[] = "\\e".toCharArray();
@@ -47,32 +48,34 @@
public JSEncoder() {}
/**
- * Return true or false wether this encoding can encode the specified
+ * Return true or false whether this encoding/format can encode the specified
* character or not.
* <p>
* This method will return true for the following character range: <br />
* <code>
- * <nobr>#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]</nobr>
+ * <nobr>\b | \f | \t | \r | \n | " | \ | / | [#x20-#xD7FF] | [#xE000-#xFFFD]</nobr>
* </code>
* </p>
*
* @see <a href="http://www.w3.org/TR/REC-xml#charsets">W3C XML 1.0 </a>
+ * @see <a href="http://json.org/">JSON.org</a>
*/
public boolean compile(char c) {
- if ((c == 0x09) || // [\t]
- (c == 0x0a) || // [\n]
- (c == 0x0d) || // [\r](c == 0x22) || // ["]
- (c == 0x22) || // ["]
- (c == 0x27) || // [']
- (c == 0x5c) || // [\]
- (c == 0x03) || // [esc]
- (c == ']') || // ] - to avoid conflicts in CDATA
- (c == '<') || // - escape HTML markup characters
- (c == '>') || // - HTML
- (c == '&') || // - HTML
- (c == '-') || // - HTML comments
- (c < 0x20) || // See <http://www.w3.org/TR/REC-xml#charsets>
- ((c > 0xd7ff) && (c < 0xe000)) || (c > 0xfffd) || (c > 0xff)) {
+ if ((c == '\b') ||
+ (c == '\f') |
+ (c == '\t') ||
+ (c == '\n') ||
+ (c == '\r') ||
+ (c == '"') ||
+ (c == '\\') ||
+ (c == '/') ||
+ (c == ']') || // ] - to avoid conflicts in CDATA
+ (c == '<') || // - escape HTML markup characters
+ (c == '>') || // - HTML
+ (c == '&') || // - HTML
+ (c == '-') || // - HTML comments
+ (c < 0x20) || // See <http://www.w3.org/TR/REC-xml#charsets>
+ ((c > 0xd7ff) && (c < 0xe000)) || (c > 0xfffd) || (c > 0xff)) {
return false;
}
@@ -85,39 +88,36 @@
*/
public char[] encode(char c) {
switch (c) {
- case 0x03 :
- return ENCODE_FF; // (>) [>]
+ case '\b' :
+ return ENCODE_BC;
+
+ case '\f' :
+ return ENCODE_FF;
- case 0x09 :
- return ENCODE_TAB; // (>) [>]
+ case '\t' :
+ return ENCODE_TAB;
- case 0x0a :
- return ENCODE_LF; // (>) [>]
+ case '\n' :
+ return ENCODE_LF;
- case 0x0d :
- return ENCODE_CR; // (>) [>]
+ case '\r' :
+ return ENCODE_CR;
- case 0x22 :
- return ENCODE_QUOT; // (") ["]
+ case '"' :
+ return ENCODE_QUOT;
- case 0x27 :
- return ENCODE_APOS; // (') [']
+ case '\\' :
+ return ENCODE_BS;
- case 0x5c :
- return ENCODE_BS; // (<) [<]
-
+ case '/' :
+ return ENCODE_FS;
+
default : {
- if (c > 0xff) {
- char[] ret = {
- '\\', 'u', ENCODE_HEX[c >> 0xc & 0xf], ENCODE_HEX[c >> 0x8 & 0xf], ENCODE_HEX[c >> 0x4 & 0xf],
- ENCODE_HEX[c & 0xf]
- };
+ char[] ret = {
+ '\\', 'u', ENCODE_HEX[c >> 0xc & 0xf], ENCODE_HEX[c >> 0x8 & 0xf], ENCODE_HEX[c >> 0x4 & 0xf],
+ ENCODE_HEX[c & 0xf]
+ };
- return ret;
- }
-
- char[] ret = {'\\', 'x', ENCODE_HEX[c >> 0x4 & 0xf], ENCODE_HEX[c & 0xf]};
-
return ret;
}
}
Modified: trunk/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java
===================================================================
--- trunk/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java 2010-09-01 14:58:06 UTC (rev 19077)
+++ trunk/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java 2010-09-01 15:03:14 UTC (rev 19078)
@@ -123,9 +123,9 @@
* Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
*/
public void testStringToScript() {
- Object obj = "foo";
+ Object obj = "f \b\r\t\f\n\"'\\/ oo";
- assertEquals("\"foo\"", ScriptUtils.toScript(obj));
+ assertEquals("\"f \\b\\r\\t\\f\\n\\\"'\\\\\\/ oo\"", ScriptUtils.toScript(obj));
}
/**
@@ -260,8 +260,8 @@
public void testAddEncoded() {
StringBuilder buff = new StringBuilder();
- ScriptUtils.addEncoded(buff, "foo\"\'");
- assertEquals("foo\\\"\\\'", buff.toString());
+ ScriptUtils.addEncoded(buff, "foo");
+ assertEquals("foo", buff.toString());
}
/**
14 years, 3 months
JBoss Rich Faces SVN: r19077 - branches/autocomplete/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-09-01 10:58:06 -0400 (Wed, 01 Sep 2010)
New Revision: 19077
Modified:
branches/autocomplete/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
Log:
https://jira.jboss.org/browse/RF-8875
Modified: branches/autocomplete/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
===================================================================
--- branches/autocomplete/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2010-09-01 14:57:22 UTC (rev 19076)
+++ branches/autocomplete/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2010-09-01 14:58:06 UTC (rev 19077)
@@ -118,7 +118,7 @@
ajaxMode:true,
lazyClientMode:false,
isCachedAjax:true,
- tokens: ",",
+ tokens: "",
attachToBody:true
};
14 years, 3 months
JBoss Rich Faces SVN: r19076 - in modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer: bean and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-09-01 10:57:22 -0400 (Wed, 01 Sep 2010)
New Revision: 19076
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAjaxBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAttachQueueBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandButtonBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandLinkBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JJSFunctionBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JLogBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JMediaOutputBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JParamBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JRegionBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/CommandButtonBean.java
Log:
* info logging messages changed to debug
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java 2010-09-01 14:49:53 UTC (rev 19075)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java 2010-09-01 14:57:22 UTC (rev 19076)
@@ -105,8 +105,8 @@
}
}
- logger.info(attributes.keySet().toString());
-
+ logger.debug(attributes.keySet().toString());
+
loadHelp();
loadSelectOptions();
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAjaxBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAjaxBean.java 2010-09-01 14:49:53 UTC (rev 19075)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAjaxBean.java 2010-09-01 14:57:22 UTC (rev 19076)
@@ -59,7 +59,7 @@
@PostConstruct
public void init() {
logger = LoggerFactory.getLogger(getClass());
- logger.info("initializing bean " + getClass().getName());
+ logger.debug("initializing bean " + getClass().getName());
attributes = Attributes.getBehaviorAttributes(AjaxBehavior.class, getClass());
// the 'event' attribute for behavior tag must be a literal
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAttachQueueBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAttachQueueBean.java 2010-09-01 14:49:53 UTC (rev 19075)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAttachQueueBean.java 2010-09-01 14:57:22 UTC (rev 19076)
@@ -55,7 +55,7 @@
@PostConstruct
public void init() {
logger = LoggerFactory.getLogger(getClass());
- logger.info("initializing bean " + getClass().getName());
+ logger.debug("initializing bean " + getClass().getName());
// initialize attributes
attributes = Attributes.getUIComponentAttributes(UIAttachQueue.class, getClass());
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandButtonBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandButtonBean.java 2010-09-01 14:49:53 UTC (rev 19075)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandButtonBean.java 2010-09-01 14:57:22 UTC (rev 19076)
@@ -60,7 +60,7 @@
@PostConstruct
public void init() {
logger = LoggerFactory.getLogger(getClass());
- logger.info("initializing bean " + getClass().getName());
+ logger.debug("initializing bean " + getClass().getName());
attributes = Attributes.getUIComponentAttributes(UICommandButton.class, getClass());
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandLinkBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandLinkBean.java 2010-09-01 14:49:53 UTC (rev 19075)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandLinkBean.java 2010-09-01 14:57:22 UTC (rev 19076)
@@ -58,7 +58,7 @@
@PostConstruct
public void init() {
logger = LoggerFactory.getLogger(getClass());
- logger.info("initializing bean " + getClass().getName());
+ logger.debug("initializing bean " + getClass().getName());
attributes = Attributes.getUIComponentAttributes(UICommandLink.class, getClass());
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JJSFunctionBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JJSFunctionBean.java 2010-09-01 14:49:53 UTC (rev 19075)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JJSFunctionBean.java 2010-09-01 14:57:22 UTC (rev 19076)
@@ -56,7 +56,7 @@
@PostConstruct
public void init() {
logger = LoggerFactory.getLogger(getClass());
- logger.info("initializing bean " + getClass().getName());
+ logger.debug("initializing bean " + getClass().getName());
year = Integer.parseInt(new SimpleDateFormat("yyyy").format(new Date()));
// initialize attributes
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JLogBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JLogBean.java 2010-09-01 14:49:53 UTC (rev 19075)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JLogBean.java 2010-09-01 14:57:22 UTC (rev 19076)
@@ -54,7 +54,7 @@
@PostConstruct
public void init() {
logger = LoggerFactory.getLogger(getClass());
- logger.info("initializing bean " + getClass().getName());
+ logger.debug("initializing bean " + getClass().getName());
name = "John";
attributes = Attributes.getUIComponentAttributes(UIAjaxLog.class, getClass());
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JMediaOutputBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JMediaOutputBean.java 2010-09-01 14:49:53 UTC (rev 19075)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JMediaOutputBean.java 2010-09-01 14:57:22 UTC (rev 19076)
@@ -62,7 +62,7 @@
@PostConstruct
public void init() {
logger = LoggerFactory.getLogger(getClass());
- logger.info("initializing bean " + getClass().getName());
+ logger.debug("initializing bean " + getClass().getName());
attributes = Attributes.getUIComponentAttributes(UIMediaOutput.class, getClass());
attributes.setAttribute("session", true);
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JParamBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JParamBean.java 2010-09-01 14:49:53 UTC (rev 19075)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JParamBean.java 2010-09-01 14:57:22 UTC (rev 19076)
@@ -56,7 +56,7 @@
@PostConstruct
public void init() {
logger = LoggerFactory.getLogger(getClass());
- logger.info("initializing bean " + getClass().getName());
+ logger.debug("initializing bean " + getClass().getName());
attributes = Attributes.getUIComponentAttributes(UIActionParameter.class, getClass());
attributes.setAttribute("name", "param");
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JRegionBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JRegionBean.java 2010-09-01 14:49:53 UTC (rev 19075)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JRegionBean.java 2010-09-01 14:57:22 UTC (rev 19076)
@@ -70,7 +70,7 @@
@PostConstruct
public void init() {
logger = LoggerFactory.getLogger(getClass());
- logger.info("initializing bean " + getClass().getName());
+ logger.debug("initializing bean " + getClass().getName());
user1 = new Employee();
user2 = new Employee();
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/CommandButtonBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/CommandButtonBean.java 2010-09-01 14:49:53 UTC (rev 19075)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/CommandButtonBean.java 2010-09-01 14:57:22 UTC (rev 19076)
@@ -58,7 +58,7 @@
@PostConstruct
public void init() {
logger = LoggerFactory.getLogger(getClass());
- logger.info("initializing bean " + getClass().getName());
+ logger.debug("initializing bean " + getClass().getName());
attributes = Attributes.getUIComponentAttributes(HtmlCommandButton.class, getClass());
14 years, 3 months
JBoss Rich Faces SVN: r19075 - in branches/RF-7560/core/api/src: test/java/org/ajax4jsf/javascript and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-09-01 10:49:53 -0400 (Wed, 01 Sep 2010)
New Revision: 19075
Modified:
branches/RF-7560/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java
branches/RF-7560/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java
Log:
https://jira.jboss.org/browse/RF-9285
Modified: branches/RF-7560/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java
===================================================================
--- branches/RF-7560/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java 2010-09-01 14:18:00 UTC (rev 19074)
+++ branches/RF-7560/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java 2010-09-01 14:49:53 UTC (rev 19075)
@@ -31,13 +31,14 @@
// private char APOSTROPHE[] = { '\\', '\'' };
private static final char[] ENCODE_HEX = "0123456789ABCDEF".toCharArray();
- private static final char[] ENCODE_APOS = "\\'".toCharArray();
private static final char[] ENCODE_QUOT = "\\\"".toCharArray();
private static final char[] ENCODE_LF = "\\n".toCharArray();
+ private static final char[] ENCODE_BC = "\\b".toCharArray();
private static final char[] ENCODE_FF = "\\f".toCharArray();
private static final char[] ENCODE_CR = "\\r".toCharArray();
private static final char[] ENCODE_TAB = "\\t".toCharArray();
private static final char[] ENCODE_BS = "\\\\".toCharArray();
+ private static final char[] ENCODE_FS = "\\/".toCharArray();
// private static final char ENCODE_ESC[] = "\\e".toCharArray();
@@ -47,32 +48,34 @@
public JSEncoder() {}
/**
- * Return true or false wether this encoding can encode the specified
+ * Return true or false whether this encoding/format can encode the specified
* character or not.
* <p>
* This method will return true for the following character range: <br />
* <code>
- * <nobr>#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]</nobr>
+ * <nobr>\b | \f | \t | \r | \n | " | \ | / | [#x20-#xD7FF] | [#xE000-#xFFFD]</nobr>
* </code>
* </p>
*
* @see <a href="http://www.w3.org/TR/REC-xml#charsets">W3C XML 1.0 </a>
+ * @see <a href="http://json.org/">JSON.org</a>
*/
public boolean compile(char c) {
- if ((c == 0x09) || // [\t]
- (c == 0x0a) || // [\n]
- (c == 0x0d) || // [\r](c == 0x22) || // ["]
- (c == 0x22) || // ["]
- (c == 0x27) || // [']
- (c == 0x5c) || // [\]
- (c == 0x03) || // [esc]
- (c == ']') || // ] - to avoid conflicts in CDATA
- (c == '<') || // - escape HTML markup characters
- (c == '>') || // - HTML
- (c == '&') || // - HTML
- (c == '-') || // - HTML comments
- (c < 0x20) || // See <http://www.w3.org/TR/REC-xml#charsets>
- ((c > 0xd7ff) && (c < 0xe000)) || (c > 0xfffd) || (c > 0xff)) {
+ if ((c == '\b') ||
+ (c == '\f') |
+ (c == '\t') ||
+ (c == '\n') ||
+ (c == '\r') ||
+ (c == '"') ||
+ (c == '\\') ||
+ (c == '/') ||
+ (c == ']') || // ] - to avoid conflicts in CDATA
+ (c == '<') || // - escape HTML markup characters
+ (c == '>') || // - HTML
+ (c == '&') || // - HTML
+ (c == '-') || // - HTML comments
+ (c < 0x20) || // See <http://www.w3.org/TR/REC-xml#charsets>
+ ((c > 0xd7ff) && (c < 0xe000)) || (c > 0xfffd) || (c > 0xff)) {
return false;
}
@@ -85,39 +88,36 @@
*/
public char[] encode(char c) {
switch (c) {
- case 0x03 :
- return ENCODE_FF; // (>) [>]
+ case '\b' :
+ return ENCODE_BC;
+
+ case '\f' :
+ return ENCODE_FF;
- case 0x09 :
- return ENCODE_TAB; // (>) [>]
+ case '\t' :
+ return ENCODE_TAB;
- case 0x0a :
- return ENCODE_LF; // (>) [>]
+ case '\n' :
+ return ENCODE_LF;
- case 0x0d :
- return ENCODE_CR; // (>) [>]
+ case '\r' :
+ return ENCODE_CR;
- case 0x22 :
- return ENCODE_QUOT; // (") ["]
+ case '"' :
+ return ENCODE_QUOT;
- case 0x27 :
- return ENCODE_APOS; // (') [']
+ case '\\' :
+ return ENCODE_BS;
- case 0x5c :
- return ENCODE_BS; // (<) [<]
-
+ case '/' :
+ return ENCODE_FS;
+
default : {
- if (c > 0xff) {
- char[] ret = {
- '\\', 'u', ENCODE_HEX[c >> 0xc & 0xf], ENCODE_HEX[c >> 0x8 & 0xf], ENCODE_HEX[c >> 0x4 & 0xf],
- ENCODE_HEX[c & 0xf]
- };
+ char[] ret = {
+ '\\', 'u', ENCODE_HEX[c >> 0xc & 0xf], ENCODE_HEX[c >> 0x8 & 0xf], ENCODE_HEX[c >> 0x4 & 0xf],
+ ENCODE_HEX[c & 0xf]
+ };
- return ret;
- }
-
- char[] ret = {'\\', 'x', ENCODE_HEX[c >> 0x4 & 0xf], ENCODE_HEX[c & 0xf]};
-
return ret;
}
}
Modified: branches/RF-7560/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java
===================================================================
--- branches/RF-7560/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java 2010-09-01 14:18:00 UTC (rev 19074)
+++ branches/RF-7560/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java 2010-09-01 14:49:53 UTC (rev 19075)
@@ -123,9 +123,9 @@
* Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
*/
public void testStringToScript() {
- Object obj = "foo";
+ Object obj = "f \b\r\t\f\n\"'\\/ oo";
- assertEquals("\"foo\"", ScriptUtils.toScript(obj));
+ assertEquals("\"f \\b\\r\\t\\f\\n\\\"'\\\\\\/ oo\"", ScriptUtils.toScript(obj));
}
/**
@@ -260,8 +260,8 @@
public void testAddEncoded() {
StringBuilder buff = new StringBuilder();
- ScriptUtils.addEncoded(buff, "foo\"\'");
- assertEquals("foo\\\"\\\'", buff.toString());
+ ScriptUtils.addEncoded(buff, "foo");
+ assertEquals("foo", buff.toString());
}
/**
14 years, 3 months
JBoss Rich Faces SVN: r19074 - in trunk/ui/iteration/ui/src/main/java/org/richfaces: renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-09-01 10:18:00 -0400 (Wed, 01 Sep 2010)
New Revision: 19074
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
Log:
https://jira.jboss.org/browse/RF-9145
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java 2010-09-01 14:06:56 UTC (rev 19073)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java 2010-09-01 14:18:00 UTC (rev 19074)
@@ -50,7 +50,6 @@
public static final String COMPONENT_FAMILY = "org.richfaces.Column";
-
@Attribute
public abstract boolean isBreakRowBefore();
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java 2010-09-01 14:06:56 UTC (rev 19073)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java 2010-09-01 14:18:00 UTC (rev 19074)
@@ -52,7 +52,10 @@
Iterator<UIComponent> components = row.columns();
while(components.hasNext()){
- encodeColumn(facesContext, writer, (UIColumn)components.next(),rowHolder);
+ UIColumn column = (UIColumn)components.next();
+ if(column.isRendered()) {
+ encodeColumn(facesContext, writer, column,rowHolder);
+ }
}
encodeRowEnd(writer);
}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-09-01 14:06:56 UTC (rev 19073)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-09-01 14:18:00 UTC (rev 19074)
@@ -149,72 +149,73 @@
RowHolder rowHolder = (RowHolder) holder;
Row row = rowHolder.getRow();
- AbstractDataTable dataTable = (AbstractDataTable)row;
-
- boolean partialUpdate = rowHolder.isUpdatePartial();
+ AbstractDataTable dataTable = (AbstractDataTable) row;
+
+ boolean partialUpdate = rowHolder.isUpdatePartial();
boolean parentTbodyStart = rowHolder.isEncodeParentTBody();
boolean tbodyStart = parentTbodyStart;
-
+
rowHolder.setRowStart(true);
Iterator<UIComponent> components = row.columns();
while (components.hasNext()) {
-
UIComponent child = components.next();
- if(child instanceof Row) {
- boolean isSubtable = (child instanceof AbstractSubTable);
- //new row -> close </tr>
- if (rowHolder.getProcessCell() != 0) {
- encodeRowEnd(writer);
+ if (child.isRendered()) {
+ if (child instanceof Row) {
+ boolean isSubtable = (child instanceof AbstractSubTable);
+ // new row -> close </tr>
+ if (rowHolder.getProcessCell() != 0) {
+ encodeRowEnd(writer);
- if(isSubtable) {
- encodeTableBodyEnd(writer);
- tbodyStart = false;
-
- if (partialUpdate) {
- partialEnd(facesContext);
+ if (isSubtable) {
+ encodeTableBodyEnd(writer);
+ tbodyStart = false;
+
+ if (partialUpdate) {
+ partialEnd(facesContext);
+ }
}
}
- }
-
- rowHolder.nextCell();
-
- if(isSubtable && partialUpdate){
- String id = dataTable.getRelativeClientId(facesContext) + ":"+ child.getId() +":c";
- partialStart(facesContext, id);
- }
-
- child.encodeAll(facesContext);
-
- if (isSubtable && partialUpdate) {
- partialEnd(facesContext);
- }
-
- } else if(child instanceof UIColumn) {
-
- if(!parentTbodyStart && !tbodyStart) {
- if (partialUpdate) {
- partialStart(facesContext, dataTable.getRelativeClientId(facesContext) + ":tb");
+
+ rowHolder.nextCell();
+
+ if (isSubtable && partialUpdate) {
+ String id = dataTable.getRelativeClientId(facesContext) + ":" + child.getId() + ":c";
+ partialStart(facesContext, id);
}
-
- encodeTableBodyStart(writer, facesContext, dataTable);
- rowHolder.setRowStart(true);
- tbodyStart = true;
- }
-
- encodeColumn(facesContext, writer, (UIColumn)child, rowHolder);
-
- if(!components.hasNext()) {
- encodeRowEnd(writer);
-
- if(!parentTbodyStart && tbodyStart) {
- encodeTableBodyEnd(writer);
- tbodyStart = false;
-
- if(partialUpdate) {
- partialEnd(facesContext);
+
+ child.encodeAll(facesContext);
+
+ if (isSubtable && partialUpdate) {
+ partialEnd(facesContext);
+ }
+
+ } else if (child instanceof UIColumn) {
+
+ if (!parentTbodyStart && !tbodyStart) {
+ if (partialUpdate) {
+ partialStart(facesContext, dataTable.getRelativeClientId(facesContext) + ":tb");
}
+
+ encodeTableBodyStart(writer, facesContext, dataTable);
+ rowHolder.setRowStart(true);
+ tbodyStart = true;
}
+
+ encodeColumn(facesContext, writer, (UIColumn) child, rowHolder);
+
+ if (!components.hasNext()) {
+ encodeRowEnd(writer);
+
+ if (!parentTbodyStart && tbodyStart) {
+ encodeTableBodyEnd(writer);
+ tbodyStart = false;
+
+ if (partialUpdate) {
+ partialEnd(facesContext);
+ }
+ }
+ }
}
}
}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-09-01 14:06:56 UTC (rev 19073)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-09-01 14:18:00 UTC (rev 19074)
@@ -194,18 +194,19 @@
while (components.hasNext()) {
UIComponent component = components.next();
-
- if(component instanceof UIColumn) {
- encodeColumn(facesContext, writer, (UIColumn)component , rowHolder);
-
- } else if (component instanceof AbstractSubTable) {
- if(component.isRendered()) {
- encodeRowEnd(writer);
+ if(component.isRendered()) {
+ if(component instanceof UIColumn ) {
+ encodeColumn(facesContext, writer, (UIColumn)component , rowHolder);
+
+ } else if (component instanceof AbstractSubTable) {
+ if(component.isRendered()) {
+ encodeRowEnd(writer);
+ }
+
+ component.encodeAll(facesContext);
+ rowHolder.setRowStart(true);
}
-
- component.encodeAll(facesContext);
- rowHolder.setRowStart(true);
- }
+ }
}
encodeRowEnd(writer);
14 years, 3 months