Guest User

Untitled

a guest
Sep 13th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. What is the JSF 2.0 code for handling user authentication?
  2. <form method="POST" action="j_security_check">
  3. <table cellpadding="0" cellspacing="0" border="0">
  4. <tr>
  5. <td align="right">Username:&nbsp;</td>
  6. <td>
  7. <input type="text" name="j_username">
  8. </td>
  9. </tr>
  10. <tr>
  11. <td align="right">Password:&nbsp;</td>
  12. <td>
  13. <input type="password" name="j_password">
  14. </td>
  15. </tr>
  16. <tr>
  17. <td></td>
  18. <td>
  19. <input type="submit" value="Login">
  20. </td>
  21. </tr>
  22. </table>
  23. </form>
  24.  
  25. request.getUserPrincipal();
  26.  
  27. FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal();
Add Comment
Please, Sign In to add comment