Question
Java | Answer them all 15. Given a JSP page with the line: ${101 % 10} What will be displayed? (a)1 (b)10 (c)1001 (d)101 %
Java | Answer them all
15. Given a JSP page with the line:
${101 % 10}
What will be displayed?
(a)1
(b)10
(c)1001
(d)101 % 10
(E){101 % 10}
16. If in a JSP there are the following two lines,
when you display the EL expression${newcolor}, what will you see?
(a)red
(b)red
(c)red
(d)red
17. Assume that the named variable mylist is a List
at least 5 elements. Which of the following expressions sometimes valid and some-
times invalid?
(a)${mylist[3]}
(b)${mylist["4"]}
(c)${mylist["idx" + 2]}
(d)${mylist[idx + 2]}
18. Which of the following ways can be used to separate the nullvalue and the empty string?
(a)using the length function in the JSTLs function package
(b)using the empty operator, like${empty somevar}, to check
(c)comparing the value to null, like ${somevar == null}
19. Which statements about the.(dot) and[]EL operators are true? (Choose all that apply.)
(a)${foo.bar} is equivalent to ${foo["bar"]}
(b)${foo["5"]} is valid syntax if foo is a Map
(c)${header.User-Agent} is equivalent to ${header[User-Agent]}
(d)${header.User-Agent} is equivalent to ${header["User-Agent"]}
(e)${foo[5]} is valid syntax if foo is a List or an array
20. Which of the following pair of expressions are always equivalent? (Assume that allthe leading named variables are valid objects that are notnull.)
(a)${mybean.myval} and ${mybean[myval]}
(b)${myobj["4"]} and ${myobj[4]}
(c)${header.User-Agent} and ${header[User-Agent]}
(d)${mydata.myname} and ${mydata["myname"]}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started