Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsrinivasan2012-05-19 01:30:51 -0400
committerrsrinivasan2012-05-19 01:30:51 -0400
commitbc2f92bad3b5fa3be96705ce970a8afde1405417 (patch)
tree99be2e7d7d8f1efa2ad9dc3f7f88fa11586b37be
parentc6183d6b447fa23a26c368cd0433e51e4d152614 (diff)
downloadwebtools.jsf-bc2f92bad3b5fa3be96705ce970a8afde1405417.tar.gz
webtools.jsf-bc2f92bad3b5fa3be96705ce970a8afde1405417.tar.xz
webtools.jsf-bc2f92bad3b5fa3be96705ce970a8afde1405417.zip
Bug 374535 - [hotbug] False warning from facelet validator for the attribute value #{resource['lib:file']}
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/ELExpressionValidator.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/ELExpressionValidator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/ELExpressionValidator.java
index 7eecb4cc9..c26a561cd 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/ELExpressionValidator.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/ELExpressionValidator.java
@@ -65,6 +65,11 @@ public class ELExpressionValidator
*/
public ASTExpression validateXMLNode()
{
+ //Bug 325496 - [JSF2.0] False warning from facelet validator for the attribute value #{resource['lib:file']}
+ if (isELResourceReference(_elText)) {
+ return null;
+ }
+
JSPELParser elParser = JSPELParser.createParser(_elText);
// =
try {
@@ -115,6 +120,23 @@ public class ELExpressionValidator
return null;
}
}
+
+ private boolean isELResourceReference(String elText) {
+ boolean isResource = false;
+ //does EL contain enough chars?
+ if (elText != null && elText.length() > 8) {
+ //does EL begin with "resource[" and end with "]"?
+ if (elText.toLowerCase().startsWith("resource[") && //$NON-NLS-1$
+ elText.endsWith("]")) { //$NON-NLS-1$
+ //is project JSF 2.0 or greater?
+ if (ELValidationUtil.isProjectEL22(_context)) {
+ //if all above is true, EL is a resource reference
+ isResource = true;
+ }
+ }
+ }
+ return isResource;
+ }
/**
* @return the type of the expression or null if

Back to the top