• Post Reply Bookmark Topic Watch Topic
  • New Topic

Bean property and method access

 
Patrick Bernardina
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I access some bean property which doesn't has an access method that starts with get? I there any way?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For value access methods, the only exception to method invocation is with boolean access methods. isSomeValue would return true or false rather than getSomeValue. This is just part of the JavaBean spec that won't change.

Now, as far as action and actionListener methods, changelisteners, etc they can have any name. So if you had a commandButton

<h:commandButton action="#{backingBean.doSomeAction}".../>

The method is:

public String doSomeAction
 
Patrick Bernardina
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok.

Unfortunatelly I am accessing a third party class that doesn't follow the Java Bean spec.

I will make a wrapper class to solve my problem.

thanks.
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
For value access methods, the only exception to method invocation is with boolean access methods. isSomeValue would return true or false rather than getSomeValue. This is just part of the JavaBean spec that won't change.


Unfortunately this doesn't works with IBM's implementation.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Varun Khanna:


Unfortunately this doesn't works with IBM's implementation.


I've actually heard that before and that is a bit strange to me.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!