Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

code doubt c:if

 
S Sravs
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<c:set var="result" value="false" />
<c:if test="${result=true}">
<c ut value="heloooo"/>
</c:if>

output:
compilation failed

As far as i remember if(result=true) works in core java but not in EL's
what could be the reason?

Thanks in advance
Sravanthi
 
al langley
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the EL logical operator? That might be giving you a problem...
== or eq
 
S Sravs
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know the problem
my question is core and EE difference
 
vaibhav sharma
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vijaya Sravanthi:
<c:set var="result" value="false" />
<c:if test="${result=true}">
<c ut value="heloooo"/>
</c:if>

output:
compilation failed

As far as i remember if(result=true) works in core java but not in EL's
what could be the reason?

Thanks in advance
Sravanthi





First mistake you are doing is by comparing Core Java syntax with EL syntax.Both are totally different. Apart from that the specific reason to the compilation error is that "=" operator doesnot exist in Expression Language.
[ May 06, 2008: Message edited by: vaibhav sharma ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic