Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Head first question 14 page 431

 
Frank Jacobsen
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont understand the answer ??

package com.example;
public class MyFunctions {
public static String repeat(int x,String str) {
// methoed body
}
}

and given the jsp:
<%@ taglib uri="/WEB-INF/myfuncts" prefix="my" %>
<%insert code here --%>

a) ${repeat(2, "420")}
b) ${repeat("2", "420")}
c) ${my:repeat(2, "420")}
d) ${my:repeat("2", "420")}
e) A valid invocation CANNOT be determined.

I thought the answer was 2 & 3, becouse the we can�t se the function in the DD, and maybe they call the "name" in the DD "repeat" the same name as the methoed ???

The answar was E "Option E is correct, the nessesary mapping information is not known" ???

Can somebody tell me whats wrong ???

Frank
 
Wim van Haaren
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The TLD is missing. And without the TLD the container cannot map the taglib in the JSP to the class MyFunctions.
[ November 10, 2004: Message edited by: Wim van Haaren ]
 
Frank Jacobsen
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Off course, thanks

Frank
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic