JSF - get managed bean by name

Posted by Konrad Garus on Stack Overflow See other posts from Stack Overflow or by Konrad Garus
Published on 2010-04-13T20:53:32Z Indexed on 2010/04/13 21:13 UTC
Read the original article Hit count: 716

Filed under:
|
|

I'm trying to write a custom servlet (for AJAX/JSON) in which I would like to reference my @ManagedBeans by name. I'm hoping to map:

http://host/app/myBean/myProperty

to:

@ManagedBean(name="myBean")
public class MyBean {
    public String getMyProperty();
}

Is it possible to load a bean by name from a regular servlet? Is there a JSF servlet or helper I could use for it?

I seem to be spoilt by Spring in which all this is too obvious.

© Stack Overflow or respective owner

Related posts about jsf2

Related posts about java