I am using jsecurity check for my login and I want to save the user that logged in and when they did.
How do I get these from j_security_check?
My web xml:
<login-config>
<auth-method>FORM</auth-method>
<realm-name>user-realm</realm-name>
<form-login-config>
<form-login-page>/Pages/Login.xhtml</form-login-page>
<form-error-page>/Pages/LoginError.xhtml</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description/>
<role-name>admin</role-name>
</security-role>
<security-role>
<description/>
<role-name>users</role-name>
</security-role>
My login.xhtml page:
<form role="form" action="j_security_check" method="POST">
<h2>Please sign in</h2>
<input name="j_username" type="text" placeholder="Username" required="true"> </input>
<input name="j_password" type="password" placeholder="Password" required="true"> </input>
<button type="submit" value="Login">Sign in</button>
</form>
Just want to know if I can catch the user who logs into my jsf application and save that user and the time they logged in into the database