Application app = context.getApplication();
I thought maybe it was because the context didn't exist yet. So I went to a JSF page, and then tried the servlet again, but still got the same error.
Does it work for you in just a plain servlet? Or are you still doing this from JSF based code?
thanks.
On 6/15/06, Reid, Jeff (Liquidity & Risk Technology)
<[EMAIL PROTECTED]> wrote:
Someone posted this code to get/create Managed Beans. It works for me. The param is the bean name.public static Object getBean(String expr){
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
ValueBinding binding = app.createValueBinding("#{" + expr + "}");
Object value = binding.getValue(context);
return value;
}-----Original Message-----Apologies of this is not an appropriate place to ask this since it's not specifically MyFaces related, however...
From: Gregg Bolinger [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 15, 2006 11:31 AM
To: MyFaces Discussion
Subject: Force creation of managed bean
The project I am working on is a mix of Flash (customer side) and JSF (admin side). We are not allowed to use Spring (long sad story) and so I was using JSF's managed bean facility to inject DAO's into service classes and make the service classes available via the managed bean facility as well. This works great from the JSF side of things.
But, the Flash side is using Flash Remoting to access Servlets that need to use a lot of the same services. Because managed beans are lazy loaded, when the servlets need access to the services, they aren't actually created yet.
And finally, my question...Is there a way to A) force JSF to load all managed beans immediatly, B) specify which beans should be loaded immediately, or C) somehow get a hook into the JSF side, maybe FacesContext, and initialize the bean?
Thanks.
Gregg
If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important additional terms relating to this e-mail. http://www.ml.com/email_terms/