• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL Functions vs Custom Tags

 
Joe Harry
Ranch Hand
Posts: 10128
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: 10128
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?
 
Christophe Verré
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: 10128
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