I am a little confused over when an attribute value of ${whatever} is evaluated as an 
expression and when it is treated literally.

In particular, I am noticing an inconsistency in the way an attribute value is being 
treated by <j:set> and <j:if>.  It seems that <j:set>'s value attribute is treated 
literally; however, the <j:if>'s test attribute is evaluated as an expression.

Consider the following property settings
foo-bar.baz = bing
foo_bar.baz = bing
foo.bar.baz = bing

Here are some usages:
Example 1:
<j:set var="fbb" value="${foo-bar.baz}"/>
<echo message="fbb = ${fbb}"/> 
<j:if test="${foo-bar.baz == null}">
  <echo message="foo-bar.baz is null"/>
</j:if>

This outputs 
  fbb is 0
-----------------------------------------------------
Example 2:
<j:set var="fbb" value="${foo_bar.baz}"/>
<echo message="fbb = ${fbb}"/> 
<j:if test="${foo_bar.baz == null}">
  <echo message="foo_bar.baz is null"/>
</j:if>

This outputs 
  fbb is bing
  foo_bar.baz is null   
-----------------------------------------------------
Example 3:
<j:set var="fbb" value="${foo.bar.baz}"/>
<echo message="fbb = ${fbb}"/> 
<j:if test="${foo.bar.baz == null}">
  <echo message="foo.bar.baz is null"/>
</j:if>

This outputs 
  fbb is bing
  foo.bar.baz is null   




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to