Author: maksimkaszynski
Date: 2007-10-25 08:55:56 -0400 (Thu, 25 Oct 2007)
New Revision: 3529
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/IncludeTag.java
Log:
http://jira.jboss.com/jira/browse/RF-999
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/IncludeTag.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/IncludeTag.java 2007-10-25
12:48:02 UTC (rev 3528)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/IncludeTag.java 2007-10-25
12:55:56 UTC (rev 3529)
@@ -23,6 +23,9 @@
import java.io.IOException;
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.servlet.RequestDispatcher;
@@ -135,13 +138,13 @@
}
}
- private String viewId;
+ private ValueExpression viewId;
/**
* @param viewId
* the viewId to set
*/
- public void setViewId(String viewId) {
+ public void setViewId(ValueExpression viewId) {
this.viewId = viewId;
}
@@ -162,7 +165,24 @@
*/
protected void setProperties(UIComponent component) {
super.setProperties(component);
- setStringProperty(component, "viewId", viewId);
+ UIInclude include = (UIInclude) component;
+ if (this.viewId != null) {
+ if (this.viewId.isLiteralText()) {
+ try {
+
+ String value = (String) getFacesContext().getApplication()
+ .getExpressionFactory().coerceToType(
+ this.viewId.getExpressionString(),
+ String.class);
+
+ include.setViewId(value);
+ } catch (ELException e) {
+ throw new FacesException(e);
+ }
+ } else {
+ component.setValueExpression("value", this.viewId);
+ }
+ }
}
/*