java ee - What is the JSF 2.0 code for handling user authentication? -


the standard tutorials j2ee 6 show handling of user authentication follows:

<form method="post" action="j_security_check">     <table cellpadding="0" cellspacing="0" border="0">          <tr>             <td align="right">username:&nbsp;</td>             <td>                 <input type="text" name="j_username">              </td>          </tr>          <tr>              <td align="right">password:&nbsp;</td>              <td>                 <input type="password" name="j_password">              </td>          </tr>          <tr>              <td></td>              <td>                  <input type="submit" value="login">              </td>         </tr>     </table> </form> 

the approach uses special container function "j_security_check" special fields "j_username" , "j_password".

* possible in jsf 2.0 ?
* j_username/j_password fields available after successful authentication? more precisely, how identify user after have authenticated?

any simple, example code snippets appreciated.

would possible in jsf 2.0 ?

yes. it's after bunch of html , container 1 who's doing authentication, not jsf itself. alternative programmatic login httpservletrequest#login(). allows use fullworthy jsf form jsf based validation, ajax fanciness , on em. see answer kickoff example: does jsf support form based security


are j_username/j_password fields available after successful authentication? more precisely, how identify user after have authenticated?

only username in jsf context available externalcontext#getremoteuser() , in views #{request.remoteuser}. password not available obvious security reasons.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -