Recent Notes

Displaying keyword search results 1 - 2
Created by Fang on November 14, 2011 20:50:51    Last update: November 22, 2011 09:06:10
This facelet fragment will never print anything: <ui:repeat var="person" value="#{myBean.theJTeam}"... because the test condition always returns false, even though the person var is not null. The same happens even when I define another variable with ui:param : <ui:repeat var="person" value="#{myBean.theJTeam}"... What's happening? The c:if test condition is evaluated before the ui:repeat tag had a chance to set the value! Both facelet ui tags and JSTL c tags are evaluated at the Render Response phase of the JSF lifecycle. But within the Render Response cycle, there are two sub-phases (so to speak): the first builds the UI element tree, the second renders the UI tree. The JSTL c:if tag is evaluated when the tree is built, but the facelet ui:repeat tag is evaluated when the UI...
Created by Dr. Xi on November 15, 2010 21:54:19    Last update: November 15, 2010 21:54:19
In the Perl for (foreach) loop, the looping variable is actually an alias (reference) to the original variable. Therefore, any changes applied to that variable are reflected in the original variable: C:\>perl @a = ('1', '2', '3'); for my $i (@a... This trick can be used to trim a Perl string: C:\>perl $s = ' abcd '; for ($s){ ...