0

I've read the excellent and thorough Spring documentation here on integrating JSF with Spring. I've read several answers on the subject on SO such as this one and this one. These completely answer how and why you would integrate these two containers, most importantly how to configure faces-config.xml. I have several production applications that integrate Spring 3.X and Primefaces 6.X beautifully. However I still don't quite understand what's going on under the covers and what the faces-context.xml el-resolver syntax is doing and I'd like to. I think both containers are running but since I have no JSF annotations, the JSF container is sort of idling in the background, not instantiating or managing anything, only providing a rich component library, while the Spring container does the heavy lifting. Is the JSF container delegating to Spring somehow? Are both containers/contexts "contained" within the app server container/context, or do all three operate independently?

This all begs the question, why two containers (really three, since the app server is a container, too) with one doing nothing? Will we ever get to a place where there is only one container, and frameworks like Spring and JSF simply use the app server container?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
snakedog
  • 357
  • 1
  • 2
  • 13
  • Since in the last 7 years I had no reason to use it and there are articles on SO on (dis)advantages of JSF and SpringMVC: https://stackoverflow.com/questions/18744910/using-jsf-as-view-technology-of-spring-mvc. Spring has advantages to those who want to use it like that... Just not for me, sorry. (I don't hate spring or anything, just never needed it recently) Regarding the Spring EL resolver, start by reading the Oracle docs about EL resolvers and you will know what it does and why a Spring Resolver is needed. https://stackoverflow.com/questions/28462342/el-resolver-in-faces-config-xml – Kukeltje Jun 20 '17 at 17:50
  • _"Will we ever get to a place where there is only one container,"_ This time has already arrived. Using the latest Java EE servers and CDI (managed beans) there is one container managing things... I'm using it all the time. – Kukeltje Jun 20 '17 at 17:52
  • Thanks so much for your quick responses. How awesome is SO for getting straight to recognized authorities. The [duplicate question cited](https://stackoverflow.com/questions/28462342/el-resolver-in-faces-config-xml) does help me understand how references in facelets are resolved, and how CDI simplifies container management is very welcome news, thank you. @BalusC's many JSF overviews on SO are really helpful but I'm also interested to learn how the containers interact when there are multiple - if that makes any sense - although with the latest CDI this may be moot now. – snakedog Jun 20 '17 at 20:22

0 Answers0