• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

page 423 question 14. HFSCWCD

 
Arvind Mahendra
Ranch Hand
Posts: 1162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
given:
package com.example;
public class MyFunctions {
public static String repeat(int x, String str) {
//method body
}
}
and given the JSP:
1. <%@ taglib uri="/WEB-INF/myfuncts" prefix="my" %>
2. <%-- insert code here --%>

the right answer is given as E, A valid invocation CANNOT be determined.

My question: What's wrong with option C. ${my:repeat(2, "420")} ??
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe because you don't know the uri associated to this tag library.
 
Abhishek Pratap
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be they need TLD also...
 
Yoshita Jain
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be they need TLD also...


Yes, as per the explanation.
To determine a valid invocation we need to know the value of <name>...</name>

With any of the other answers we would have to assume that 'repeat' is the function name.

Yoshita
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To determine a valid invocation we need to know the value of <name>...</name>

You mean <uri>...</uri> ?
 
Yoshita Jain
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean
<function>
<name>..</name>
...
</function>

in the tld.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. I forgot we were talking about functions
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic