JSF and form-based authentication using Spring Security to display logged-in user
In the previous recipe, we demonstrated the implementation of form-based authentication using Spring Security and JSF phaseListener
. In this section we will display the logged in user.
Getting ready
You have to perform some minor changes in the Supplier.jsp
file.
How do it...
Perform the following steps to display the logged in user details on the browser:
- To display the logged in user, access the managed bean object in your secured page.
- In the
Supplier.jsp
file, edit the following:<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html...