You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2008/11/05 14:47:11 UTC
svn commit: r711565 -
/myfaces/orchestra/trunk/flow/src/main/java/org/apache/myfaces/orchestra/flow/components/FlowCallComponent.java
Author: skitching
Date: Wed Nov 5 05:47:11 2008
New Revision: 711565
URL: http://svn.apache.org/viewvc?rev=711565&view=rev
Log:
Add comment only (re need to parse EL expressions immediately)
Modified:
myfaces/orchestra/trunk/flow/src/main/java/org/apache/myfaces/orchestra/flow/components/FlowCallComponent.java
Modified: myfaces/orchestra/trunk/flow/src/main/java/org/apache/myfaces/orchestra/flow/components/FlowCallComponent.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/flow/src/main/java/org/apache/myfaces/orchestra/flow/components/FlowCallComponent.java?rev=711565&r1=711564&r2=711565&view=diff
==============================================================================
--- myfaces/orchestra/trunk/flow/src/main/java/org/apache/myfaces/orchestra/flow/components/FlowCallComponent.java (original)
+++ myfaces/orchestra/trunk/flow/src/main/java/org/apache/myfaces/orchestra/flow/components/FlowCallComponent.java Wed Nov 5 05:47:11 2008
@@ -66,6 +66,7 @@
public static final String COMPONENT_FAMILY = "javax.faces.Component";
public static final String COMPONENT_TYPE = "org.apache.myfaces.orchestra.flow.components.FlowCall";
+ // This must not be transient; it is needed during postback
private FlowCall flowCall;
private transient String outcome;
@@ -112,6 +113,26 @@
try
{
+ // Parse the plain xml that is nested within this component.
+ //
+ // Note that it is important that any EL expressions within this text content be converted into
+ // real EL-expression objects immediately, rather than simply being stored as strings and the
+ // EL expression objects being created later when needed. The reason is that during the building
+ // of the component tree, the "current expression context" may be modified. Creating an EL
+ // expression captures the current state of the "expression context" so that when the EL expression
+ // is later executed it runs with the appropriate environment. In particular, the Facelets
+ // ui:include tag can include ui:param tags that expose data to the nested components, effectively
+ // mapping a name to another EL expression during the build-tree phase (note: the param-expression
+ // is not *evaluated*; the name maps to the expression itself, not its value). When the included page
+ // creates EL objects, they internally remember the current mappings. During rendering, the ui:param
+ // settings are *not* restored; rendering simply walks the tree of components and a ui:include is not
+ // a component. However the EL expression objects have enough info to recreate the ui:param settings
+ // that existed when the EL expression was created, so setValue and getValue work ok.
+ //
+ // Of course, the above only applies when running in an environment that supports javax.el (ie JSF1.2
+ // or JSF1.1 with Facelets). For JSF1.1 with JSP, this is not relevant; there is no standard support
+ // for passing "parameters" to included files. There is one non-standard way: the Tomahawk t:aliasBean
+ // tag. I don't know how that works with respect to orchestra flow....
flowCall = new FlowCall();
flowCall.setOutcome(outcome);
flowCall.setViewId(viewId);