In this recipe, we will use Spring security support to develop a JSF login application. The big surprise is that we will not use the classical approach, which is very complicated and problematic.
We have developed this recipe with NetBeans 6.8, JSF 2.0, and GlassFish v3. The JSF 2.0 classes were obtained from the NetBeans JSF 2.0 bundled library. In addition, we have used Acegi/Spring libraries, which provide support for JSF 2.0. The necessary libraries are in the book code bundle, under the
/JSF_libs/Acegi-Spring JSF 2.0 folder.
The key of this recipe consists in using an
HttpRequestDispatcher to provide support for JSF and Spring Security to function properly (JSF first, ...