File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes code doubt  c:if Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "code doubt  c:if" Watch "code doubt  c:if" New topic
Author

code doubt c:if

S Sravs
Ranch Hand

Joined: Feb 25, 2008
Posts: 85
<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

Joined: Mar 28, 2008
Posts: 35
Check the EL logical operator? That might be giving you a problem...
== or eq
S Sravs
Ranch Hand

Joined: Feb 25, 2008
Posts: 85
i know the problem
my question is core and EE difference
vaibhav sharma
Greenhorn

Joined: Aug 18, 2006
Posts: 1
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: code doubt c:if
 
Similar Threads
c:if
problem with EL inside c:if test attribute="${x}"
c:if and c:choose
JSTL + if statement
How to pass attribute to a custom tag only if it evaluates to a non null value