aspose file tools
The moose likes JSF and the fly likes Bean property and method access Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Bean property and method access" Watch "Bean property and method access" New topic
Author

Bean property and method access

Patrick Bernardina
Greenhorn

Joined: Jul 18, 2005
Posts: 7
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

Joined: Jul 11, 2001
Posts: 15230

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

Joined: Jul 18, 2005
Posts: 7
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

Joined: May 30, 2002
Posts: 1400
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.


- Varun
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

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.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: Bean property and method access
 
Similar Threads
managed bean injection problem
Spring MVC - How to access normal bean in spring mvc
Horrendous EL problem
How to get an inner property using tags?
EJB 2.1 weblogic 10.3 SFSB concurrent access issue