File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Certification
»
Web Component Certification (SCWCD/OCPJWCD)
Author
Doubt in EL
Shruthi Sam
Ranch Hand
Joined: Jul 09, 2008
Posts: 73
posted
Dec 30, 2009 23:21:49
0
In HFSJ, page no: 398
Given
Servlet
Code:
String num="2"; request.setAttribute("num", num); Integer i = new Integer(3); request.setAttribute("integer", i); java.util.ArrayList list = new java.util.ArrayList(); list.add("true"); list.add("false"); list.add("2"); list.add("10"); request.setAttribute("list", list);
The question is: The following will print what?
${list[0] || list["1"] and true }
The answer given is "true". Can anybody please clarify this?
What i thought was...
list[0] - true
list[1] - false
it will be ${true || false and true}
${true || false}
==> false
Please clarify.
Vijitha Kumara
Bartender
Joined: Mar 24, 2008
Posts: 3673
I like...
posted
Dec 30, 2009 23:50:10
0
${true || false}
==> false
Is that how "||" (logical OR) operator works?
SCJP 5 | SCWCD 5
[
How to ask questions
] [
Twitter
]
Shruthi Sam
Ranch Hand
Joined: Jul 09, 2008
Posts: 73
posted
Dec 31, 2009 01:10:21
0
Oops....Sorry...
Thanks for pointing it out. Somehow i mistook.
I agree. Here's the link:
http://aspose.com/file-tools
subject: Doubt in EL
Similar Threads
EL operator
EL and Accessing request scope attributes
Trouble understanding evaluation of EL string literal
EL arithmetic question
Doubt in HFSJ page-420
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter