• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

EL Functions vs Custom Tags  RSS feed

 
Ranch Hand
Posts: 10191
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

What exactly is the difference between EL Functions and Custom tags that we write. Both has a similar flow when actually writing them.
 
Joe Harry
Ranch Hand
Posts: 10191
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also why is that EL functions should be public and static?
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Functions are declared the following way :


Let's think about it. Would it make sense if the container had to create a new instance of the class (declared in the function-class tag), call the function (which must be public anyway), and then discard the instance ?
There's no point in making new instances, that's why EL functions are static.

Why using functions ? I'm not sure about the real "raison d'etre". But let's imagine that you have some existing code, like common methods in a utility class. Wouldn't it be cool if you call those utility methods, instead of making another tag ?
 
Joe Harry
Ranch Hand
Posts: 10191
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All right Satou...you convinced me!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!