Injection vs. get bean via application context
843844Sep 25 2007 — edited Sep 26 2007Hi all,
I'm quite new to JSF and Spring and theres one question that bothers me. I use JSF together with Spring and all the managed beans are created via the spring framework.
It ist possible to inject the spring beans (dao) into the managed beans but you can also access the beans via:
ApplicationContext ctx = FacesContextUtils.getWebApplicationContext(FacesContext.getCurrentInstance());
ctx.getBean(....
Which is the best method and what are the advantages/disadvatages of each method.
Regards
Matt