<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>loadBundle | LogikDevelopment</title>
	<atom:link href="https://www.logikdev.com/tag/loadbundle/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.logikdev.com</link>
	<description>&#34;Il n&#039;y a pas de problème, il n&#039;y a que des solutions. L&#039;esprit de l&#039;homme invente ensuite le problème.&#34; André Gide</description>
	<lastBuildDate>Tue, 25 Apr 2017 13:57:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>
	<item>
		<title>loadBundle&#8217;s behaviour with JSTL tags</title>
		<link>https://www.logikdev.com/2010/10/02/loadbundles-behaviour-with-jstl-tags/</link>
					<comments>https://www.logikdev.com/2010/10/02/loadbundles-behaviour-with-jstl-tags/#respond</comments>
		
		<dc:creator><![CDATA[smoreau]]></dc:creator>
		<pubDate>Sat, 02 Oct 2010 11:48:32 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[JSTL]]></category>
		<category><![CDATA[loadBundle]]></category>
		<category><![CDATA[resource bundle]]></category>
		<category><![CDATA[RichFaces]]></category>
		<guid isPermaLink="false">https://www.logikdev.com/?p=806</guid>

					<description><![CDATA[<p>Let&#8217;s start with a bit of knowledge. f:loadBundle is a JSF tag which loads a resource bundle and saves it as a variable in the request scope. The RichFaces a4j:loadBundle tag is a substitution for the f:loadBundle tag and allows to use reference to bundle messages during the Ajax re-rendering. When I discovered the RichFaces [&#8230;]</p>
<p>The post <a href="https://www.logikdev.com/2010/10/02/loadbundles-behaviour-with-jstl-tags/">loadBundle’s behaviour with JSTL tags</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Let&#8217;s start with a bit of knowledge.<br />
<code>f:loadBundle</code> is a JSF tag which loads a resource bundle and saves it as a variable in the request scope. The RichFaces <code>a4j:loadBundle</code> tag is a substitution for the <code>f:loadBundle</code> tag and allows to use reference to bundle messages during the Ajax re-rendering.</p>
<p>When I discovered the RichFaces tag, I immediately replaced all the <code>f:loadBundle</code> tags by <code>a4j:loadBundle</code>. Was I right? I thought at first, but then I got a problem. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f641.png" alt="🙁" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>The problem was appearing when I started mixing RichFaces and JSF tags.<br />
For example, let&#8217;s take the following resource bundle:</p>
<pre class="brush: plain; title: ; notranslate">active=true</pre>
<p>And the following code:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;a4j:loadBundle basename=&quot;Messages&quot; var=&quot;msg&quot; /&gt;
Active is #{msg.active} --
&lt;c:if test=&quot;#{msg.active}&quot;&gt;
	Hello World!
&lt;/c:if&gt;
</pre>
<p>This displays &#8216;<code>Active is true --</code>&#8216;.<br />
What is wrong there? The active message is true but the <code>c:if</code> condition failed!  <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f62f.png" alt="😯" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Let&#8217;s now try the following:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;a4j:loadBundle basename=&quot;Messages&quot; var=&quot;msg&quot; /&gt;
Active is #{msg.active} --
&lt;c:if test=&quot;#{empty msg.active}&quot;&gt;
	Hello World!
&lt;/c:if&gt;
</pre>
<p>This displays &#8216;<code>Active is true -- Hello World!</code>&#8216;.<br />
What does that mean? It seems that JSTL doesn&#8217;t get the value of the <code>active</code> message but gets an empty string instead!</p>
<p>In conclusion, if the resource bundle is loading using the RichFaces tag, the messages will be not visible by the JSTL tags.<br />
To fix this problem, you will have to also load the resource bundle using the JSF tag:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;a4j:loadBundle basename=&quot;Messages&quot; var=&quot;msg&quot; /&gt;
&lt;f:loadBundle basename=&quot;Messages&quot; var=&quot;msg&quot; /&gt;
Active is #{msg.active} --
&lt;c:if test=&quot;#{msg.active}&quot;&gt;
	Hello World!
&lt;/c:if&gt;
</pre>
<p>As expected, this displays &#8216;<code>Active is true -- Hello World!</code>&#8216;. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p><p>The post <a href="https://www.logikdev.com/2010/10/02/loadbundles-behaviour-with-jstl-tags/">loadBundle’s behaviour with JSTL tags</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.logikdev.com/2010/10/02/loadbundles-behaviour-with-jstl-tags/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
