• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

code doubt c:if

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i know the problem
my question is core and EE difference
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic