You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bu...@apache.org on 2014/02/06 01:19:40 UTC
svn commit: r896561 - in /websites/staging/myfaces/trunk/content: ./
wiki/core/user-guide/configuration-of-special-features/cache-el-expressions.html
Author: buildbot
Date: Thu Feb 6 00:19:39 2014
New Revision: 896561
Log:
Staging update by buildbot for myfaces
Modified:
websites/staging/myfaces/trunk/content/ (props changed)
websites/staging/myfaces/trunk/content/wiki/core/user-guide/configuration-of-special-features/cache-el-expressions.html
Propchange: websites/staging/myfaces/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Feb 6 00:19:39 2014
@@ -1 +1 @@
-1565009
+1565012
Modified: websites/staging/myfaces/trunk/content/wiki/core/user-guide/configuration-of-special-features/cache-el-expressions.html
==============================================================================
--- websites/staging/myfaces/trunk/content/wiki/core/user-guide/configuration-of-special-features/cache-el-expressions.html (original)
+++ websites/staging/myfaces/trunk/content/wiki/core/user-guide/configuration-of-special-features/cache-el-expressions.html Thu Feb 6 00:19:39 2014
@@ -92,14 +92,13 @@ facelets compiler create all EL expressi
with this special configuration, you can reduce the time and memory
resources required to build a view. Just add this to your web.xml file:</p>
-<p><ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
- <context-param>
- <param-name>org.apache.myfaces.CACHE_EL_EXPRESSIONS</param-name>
- <param-value>always</param-value>
- </context-param>
-]
-]></ac:plain-text-body></ac:macro></p>
+<div class="codehilite"><pre><span class="nt"><context-param></span>
+ <span class="nt"><param-name></span>org.apache.myfaces.CACHE_EL_EXPRESSIONS<span class="nt"></param-name></span>
+ <span class="nt"><param-value></span>always<span class="nt"></param-value></span>
+<span class="nt"></context-param></span>
+</pre></div>
+
+
<p>There are 4 valid modes for this param:</p>
<ul>
@@ -120,29 +119,31 @@ which option can be enabled in your appl
<p>In theory the mode "always" does not work with the following
case:</p>
-<p><ac:macro ac:name="code"><ac:parameter
-ac:name="title">a.xhtml</ac:parameter><ac:plain-text-body><![CDATA[
-<ui:composition template="c.xhtml">
- <ui:param name="var1" value="value1"/>
-</ui:composition>
-]
-]></ac:plain-text-body></ac:macro></p>
-<p><ac:macro ac:name="code"><ac:parameter
-ac:name="title">b.xhtml</ac:parameter><ac:plain-text-body><![CDATA[
-<ui:composition template="c.xhtml">
- <ui:param name="var1" value="value1"/>
- <ui:param name="var2" value="value2"/>
-</ui:composition>
-]
-]></ac:plain-text-body></ac:macro></p>
-<p><ac:macro ac:name="code"><ac:parameter
-ac:name="title">c.xhtml</ac:parameter><ac:plain-text-body><![CDATA[
-<ui:composition>
- <h:outputText value="#{var1}/>
- <h:outputText value="#{var2}/>
-</ui:composition>
-]
-]></ac:plain-text-body></ac:macro></p>
+<ul>
+<li>
+<p>a.xhtml
+ :::xml
+ <ui:composition template="c.xhtml">
+ <ui:param name="var1" value="value1"/>
+ </ui:composition></p>
+</li>
+<li>
+<p>b.xhtml
+ :::xml
+ <ui:composition template="c.xhtml">
+ <ui:param name="var1" value="value1"/>
+ <ui:param name="var2" value="value2"/>
+ </ui:composition></p>
+</li>
+<li>
+<p>c.xhtml
+ :::xml
+ <ui:composition>
+ <h:outputText value="#{var1}/>
+ <h:outputText value="#{var2}/>
+ </ui:composition></p>
+</li>
+</ul>
<p>if a.xhtml view is constructed before b.xhtml, #{var2} will be cached,
even if this is not wanted and then when b.xhtml is called, the expression
will not work correctly.</p>
@@ -154,28 +155,28 @@ number of params.</p>
<p>The mode "allowCset" and "always" does not work with
the following case too:</p>
-<p><ac:macro ac:name="code"><ac:parameter
-ac:name="title">csetuse.xhtml</ac:parameter><ac:plain-text-body><![CDATA[
+<ul>
+<li>
+<p>csetuse.xhtml
+ :::xml
<c:if test="....">
<c:set var="attribute1" value="somevalue" />
</c:if></p>
-<div class="codehilite"><pre><span class="o"><</span>!<span class="o">--</span> <span class="n">some</span> <span class="n">use</span> <span class="n">of</span> <span class="n">attribute1</span> <span class="o">--></span>
-</pre></div>
-
+<!-- some use of attribute1 -->
-<p>]
-]></ac:plain-text-body></ac:macro></p>
+</li>
+</ul>
<p>The problem here consists in a value expression is created
conditionally, but if the expression is not created the first time, other
value expressions will not be marked as cachable.</p>
<p>The solution is use this syntax instead:</p>
-<p><ac:macro ac:name="code"><ac:parameter
-ac:name="title">csetuse.xhtml</ac:parameter><ac:plain-text-body><![CDATA[
- <c:set var="attribute1" value="#{somecondition ? 'somevalue' : null}"/>
-]
-]></ac:plain-text-body></ac:macro></p>
+<ul>
+<li>csetuse.xhtml
+ :::xml
+ <c:set var="attribute1" value="#{somecondition ? 'somevalue' : null}"/></li>
+</ul>
<p>In this way, any use of attribute1 will detect and handle the expression
correctly.</p>