• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is wrong with my tld

 
A. Aka
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I do not get why I am having this error :

HTTP Status 500 - /result.jsp (line: 2, column: 47) File "/DiceFunctions" not found


my tld is (which is in WEB-INF) :



my jsp is



thanks,
 
Stefan Evans
Bartender
Posts: 1691
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the example from Head First Servlets and JSP 2nd edition pg-393?

Your JSP has an incorrect invocation of the function:


ie using a colon rather than a period between "mine" and "rollIt()"

Double check the tld file is in the WEB-INF directory
Double check that the uri in the tld matches the uri specified in your JSP.
restart your servlet container to see if that might fix it.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64715
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's also a good practice to follow the conventions for URIs. In other words, they should look like a URL (even if they aren't one).
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also note the mismatch between the function names: rollIt vs. rollDice.
 
A. Aka
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Stefan Evans, I did the change by putting colon but it still does not work and everything is ok regarding the check you asked for (Double check the tld file is in the WEB-INF directory, ...)

@Ulf Dittmer, I do not think what you are saying is correct, the function name in tld does not necessary need to have the same name as the real method
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're right, I overlooked that the <name> tag was indeed for rollIt.
 
A. Aka
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the the problem, in jsp the uri should be "/WEB-INF/myFunction.tld"
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A. Aka wrote:I found the the problem, in jsp the uri should be "/WEB-INF/myFunction.tld"

auto-discovery mechanism introduced in jsp1.2. container search for tld in WEB-INF hierarchy and lib/jar's META-INF heirarchy by default.
I am not sure why this mechanism is not working in your case.
 
Stefan Evans
Bartender
Posts: 1691
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think there is an issue with the xmlns entries in your <taglib> tag.

You have:


The one that works for me is


The difference being is that the onte that works locates the web-jsptaglibrary_2_0.xsd via its full url, rather than just by name.
Unless you have web-jsptaglibrary_2_0.xsd available locally, this will probably muck things up a bit.

 
A. Aka
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Stefan Evans, you are right that was the issue and many thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic