This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting the name of the managed bean which is going to be executed by the UI component

 
khaja syed
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to get the managed bean name in the PhaseListener implementation class.For example if i am using a button component to invoke the managed bean, i need to get the name of that bean in any of the phases.I have 10 managed bean classes in my project.
Please ,can anyone help me out in resolving this requirement.


Thank you.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any given View can reference dozens (no limit) of Managed Beans. So getting "the" name of "the" managed bean is a meaningless concept.

Aside from that, you don't "execute" beans. You execute (invoke) methods. A bean can contain multiple methods.
 
Bhargavan Marepalli
Greenhorn
Posts: 15
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ Tim I think khaja was not able to express his requirement in a clear way..I hope this may be his need. Infact i have the same doubt..Let me put that

A user is Logged in and performed some actions..(Filled some form data,submitted it,viewed some links on the page and done some more actions..) and logged out..

In his particular session, some managed beans will be created and

can we get which beans are created(first time) and how many times that beans are hitted (to invoke a method or any other setting/getting values etc..) in his particular session..Is there any way of recording this in any PhaseListener or some Other thing.

Thanks,

 
Tim Holloway
Saloon Keeper
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, this sounds like one of those common situations where someone has decided on a specific low-level solution to a high-level problem. Very frequently in cases like this, if we know what the high-level problem (business case) is, we can suggest a simpler, cleaner solution.

JSF is especially prone to this syndrome because the typical programmer mindset when given a complex framework is supplied is to attempt to maximize the use of the framework-specific functions. However, JSF was designed with the goal in mind that as much functionality as possible should be using POJO techniques. That is why my cardinal rule in JSF is to always think twice before utilising anything from a javax.faces package that isn't one of the model classes. Most of the JSF functions are intended to work from the outside in (Inversion of Control) instead of the inside out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic