Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Invoke a method in EL?  RSS feed

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to invoke a bean's method in EL? There is no member variable that relates to this method. The method returns an int.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only if the method is a bean accessor. There is no mechanism, quite on purpose, to invoke general methods.
[ January 20, 2006: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Timothy Sam:
There is no member variable that relates to this method.


Remember that when it comes to beans, the absence or presence of a member variable is moot. All that matters is the property accessors and mutators that the bean exposes.
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are there any alternatives in my case then?
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for some who are reading this post that are not familliar with the terms...

accessors = getters
and
mutators = setters

I think I've read that from a book somewhere...
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Timothy Sam:
are there any alternatives in my case then?


That depends on what you are trying to do.

General method calling is not part of the EL as the framers of the JSP specification want people to start moving away from performing processing on the page and towards better practices, such as scriptless JSP pages.

If you're going to continue to use the JSP as a unit of processing rather than as a view, you might as well just continue to use Java scriplets on your pages. I do not receommend that.
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmmm... You've got a good point there... I'll find another solution... Thanks!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This related topic might be of interest.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!