EL resolver in faces-config.xml

While working with Spring -JSF integration, I see this entry in faces-config.xml .

 <application> <el-resolver> org.springframework.web.jsf.el.SpringBeanFacesELResolver </el-resolver> </application> 

Can someone explain what exactly <application> and <el-resolver> ?

+5
source share
1 answer

<application> represents the JSF application . Exactly the one you can get as

 Application application = FacesContext.getCurrentInstance().getApplication(); 

<el-resolver> represents EL resolver as a used JSF application . Exactly the one you can get as

 ELResolver elResolver = application.getELResolver(); 

What exactly they, in turn, can be read in their javadocs, which I linked above. In short, Application is basically the entire JSF configuration of the application, and ELResolver is responsible for evaluating EL expressions in the form #{...} .

In the case of SpringBeanFacesELResolver it adorns the base EL recognizer to recognize Spring managed beans, as well as Spring based on its own application context and configuration files. In other words, you can use Spring beans in JSF pages via EL.

See also:

+7
source

Source: https://habr.com/ru/post/1213163/


All Articles