• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using a javabean property without an associated getter in a JSF component  RSS feed

 
Adeel Rehman
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

If i want to display the value of duration property of a Journey Bean in a label, i would use following code , snippet

where journey is a bean containing a method with (say) following implementation


But currently i have encountered some code where the journey bean contains code similar to following (and strangely it seems to work)

The above doesn't seem right at all since it doesn't look like a proper getter method for duration, it rather seems like a generic getter method (if there is such a thing !! )
I have spent a lot of hours searching if this is possible to write such a generic getter method but couldn't find the answer

I would appreciate any guidance on this.....
 
Adeel Rehman
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scratch that ... I figured it out ...

The generic Public Object get(String key) is being used by the PropertyResolver registered in the application, i missed that the first time
 
Samuel March
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.util.Map is what the bean introspector uses in the PropertyResolver
get() and put() these belong to java.util.Map
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!