• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL question.

 
Oleksandr Usatyy
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, could you please help me understand following point.
I have following question:

You are building a dating web site. The client's date of birth is collected
along with lots of other information. You have created an EL function with the signature:
calcAge(java.util.Date):int and it is assigned to the name, age, in the namespace, funct. In one of your
JSPs you need to print a special message to clients who are younger than 25. Which EL code snippet will
return true for this condition?
A. ${calcAge(client.birthDate) < 25}
B. ${calcAge[client.birthDate] < 25}
C. ${funct:age(client.birthDate) < 25}
D. ${funct:age[client.birthDate] < 25}
E. ${funct:calcAge(client.birthDate) < 25}
F. ${funct:calcAge[client.birthDate] < 25}

For me correct answer should be E.
But C is correct.
Could you please help understand this point.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please quote your sources.

And welcome to the ranch
 
Oleksandr Usatyy
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question is from

Sun Certified Web Component Developer for J2EE 5
Version 2.73
question 155
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excuse me to insist, but which mock is it exactly ? Enthuware, Wizlabs, something else you found on the net ?
 
Oleksandr Usatyy
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry.
I founded it in the network.
It looks that it is from www.ExamWorx.com.
I don't know more details
Maybe you can suggest me other mock exams.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is assigned to the name, age, in the namespace, funct.

The name to which it is assigned need not be the same as the name of the implementing method.
 
Oleksandr Usatyy
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahhhh. Now I understand.
method name is assigned to other name like:

<uri>my</uri>
<function>
<name>age</name>
<function-class>com.someclass</function-class>
<function-signature>
int calcAge(java.util.Date)
</function-signature>
</function>

before I thought that result is assigned to age, but correct is that method name is assigned to age.
Thanks a lot for your answer. It is clear for me now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic