• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

EL expressions

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which EL expression evaluates to the request URI?
a)${requestURI}
b)${request.URI}
c)${${request.getURI}
d)${request.requestURI}
e)${requestScope.requestURI}
f)${pageContext.request.requestURI}
g)${requestScope.request.request.URI}

I think the answer is f .The answer given is a.

Given an EL function foo in namespace func ,that requires a long as a parameter and returns a map which two are valid invocations of functions foo?
a)${func(1)}
b)${foo:func(4)}
c)${func:foo(2)}
d)${foo(5):func}
e)${func:foo("easy")}
f)${func:foo("3").name}

I think one option is c .What is other one.
Thanks
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the first question, I think your answer is correct. The option A prints nothing. In case of the second question, I don't see any other valid option.

Correct me if I am wrong guys
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"f" should be the other correct option in the second question, since the return value of the function is a map, and "name" might be the key for which the value is being shown from that expression.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
f)${pageContext.request.requestURI}


c)${func:foo(2)}
e)${func:foo("easy")}

would the string coerce to a long?
 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question 1: option f

Question 2: option c,f
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For question 1 the answer is (f) and for question 2 the only correct answer i think is (c). Not sure why the questiong expects two correct choices. (f) is wrong since the function expects long. It wont automatically do new Long("3").longValue().
 
I'm all tasted up for a BLT! This tiny ad wants a monte cristo!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic