• Post Reply Bookmark Topic Watch Topic
  • New Topic

using convenience methods in jsp el  RSS feed

 
Dave Segal
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to use the EL feature of jsp to access a "convenience" method. THe method has a getter, but not an actual property. For example, I have a "Name" bean with properties of firstName, lastName, and the corresponding getFirstName() and getLastName() methods. I also have a "convenience" method, getFullName() that returns the concatanated String of firstName and lastName.

I can find references to accessing properties via the dot notation in the EL. Using this notation, I can access firstName and lastName, but I can't figure out a way to use the convenience method that puts them together. Must I use a scriptlet? Or, is there some feature of JSP that will let me do this.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the signature of the convenience method? If it is getFullName(), the EL reference is simply bean.fullName.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!