Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what's the difference between managed bean and spring controller?

I am developing spring-hibernate-jsf application but i dont understand the difference between a managedbean and a spring controller. I think managedbeans work like controllers. Is there any advantage of using controller or managedbean?

like image 327
Turgut Dsfadfa Avatar asked Apr 08 '13 12:04

Turgut Dsfadfa


1 Answers

Managed Beans provides services and are used as model for UI components. Controllers are request/response components like Servlets.

JSF is a component based web framework & Spring is a DI framework. JSF & Spring manages their own beans, so to reference ManagedBeans and inject in them you need to mark JSF ManagedBeans as Spring Controllers using @Controller annotation.

If you are thinking of replacing one with other, then no you have to use both of them if you want to use both Spring & JSF together.

like image 125
Abdullah Shaikh Avatar answered Nov 08 '22 12:11

Abdullah Shaikh