I'm learning Spring security and as I understand by using request.getUserPrincipal()
we could access the name, we could get the name with pageContext.request.userPrincipal.name
,
This is my code (everything is working) :
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page session="true"%>
<html>
<body>
<h5>Title : ${title}</h5>
<h5>Message : ${message}</h5>
<c:if test="${pageContext.request.userPrincipal.name != null}">
<h2>Hi User : ${pageContext.request.userPrincipal.name}></h2>
<br>
</c:if>
</body>
</html>
my questions are:
1). Is this name on pageContext.request.userPrincipal.name
retrieved from session? because there's <%@page session="true"%>
on the top of the form
2). Is it possible to retrieve the password also? I mean something like pageContext.request.userPrincipal.password
, if not how I could get the password in the form?
Thank you I really appreciate your help to get me understand this framework as I don't have enough money to buy some springs books, I'm just using some tutorials in the internet so your helps will be so much mean to me.