The following screenshot shows the required JSF and Spring dependencies with their versions:
The configuration files that are involved in JSF and Spring Security integration are as follows:
web.xml
: Here, we will specifyspringSecurityFilterChain
asorg.springframework.web.filter.DelegatingFilterProxy
and assign it to the filter mapping. We need to specify the listeners asContextLoaderListener
andRequestContextListener
in the same file:The following portion will have entries for the
appServlet
,Faces Servlet
, and*.jsf
pattern:root-context.xml
: The context component base package will be specified in this file:servlet-context.xml
: Theresources
mapping andInternalResourceViewResolver
will be mentioned in this file:security.xml
: This is the main file of JSF and Spring integration. We can see the authentication manager, authentication provider, and URL interceptors entries in this file: