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

Overloading an EL function defined in TLD

 
Anand Wadhwani
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to overload an EL function? Please look at following piece of TLD:



And following piece of JSP to call above two overloaded functions:



When I try to run the JSP, I get following error:

Duplicate function name rollIt in tag library /WEB-INF/eltest.tld

Could anyone please confirm that EL functions cannot be overloaded!
Thanks!
 
Kumar J
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Please change the function name...Since one is rollit()...give something else for the second one...like rollitagain()...
plz give feedback...
bye
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Anand Wadhwani:
[QB]Is it possible to overload an EL function? [QB]


I guess, the answer is Yes. But as suggested by Kumar, the names that map to the function definitions have to be unique.

JSP2.0 Specs, JSP2.6.2, page:1-77,
A tag library can have only one function element in the same tag library with the same value for their name element. If two functions have the same name, a translation-time error shall be generated.

[ May 23, 2005: Message edited by: Vishwa Kumba ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic