• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Overloading an EL function defined in TLD

 
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic