Guest User

Untitled

a guest
Dec 11th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. @ManagedProperty(value="#{sessionBean}")
  2. private SessionBean sb;
  3.  
  4. public SessionBean getSb() {
  5. return sb;
  6. }
  7.  
  8. public void setSb(SessionBean sb) {
  9. this.sb = sb;
  10. }
  11.  
  12. if(loggedIn){
  13. // registra l'evento di log nel db
  14. new EventoLog(u.getIdUtente(),TipoEvento.TIPO_EVENTO_LOGIN).insert();
  15. LOG.info(u.getCognome() +" "+ u.getNome());
  16. // carica nel session bean l'utente
  17. this.getSb().setUtente(u);
  18. // genera la matrice delle pagine autorizzate nel session bean
  19. System.out.println("------------------------------" + sb.getUtente().getUsernameApplicativo());
  20. LOG.info("Sono qui - 5");
  21.  
  22. }
  23.  
  24. <p:dialog header="Login" widgetVar="dlg" resizable="false">
  25. <h:panelGrid columns="2" cellpadding="5">
  26. <h:outputLabel for="username" value="Username:"/>
  27. <p:inputText id="username" value="#{login.username}" label="Username"/>
  28. <h:outputLabel for="password" value="Password:" />
  29. <p:password id="password" value="#{login.password}" label="Password"/>
  30. <h:outputLabel for="tipoLogin" value="Tipo login:" />
  31. <p:selectOneMenu label="tipoLogin" value="#{login.valueTipoLogin}">
  32. <f:selectItem itemLabel="" itemValue="0" />
  33. <f:selectItems value="#{applicationBean.optionTipoLogin}" />
  34. </p:selectOneMenu>
  35. <f:facet name="footer">
  36. <p:commandButton value="Login"
  37. icon="loginIcon"
  38. update="growl"
  39. actionListener="#{login.btnLogin_action()}"
  40. oncomplete="handleLoginRequest(xhr, status, args)" />
  41. </f:facet>
  42. </h:panelGrid>
  43. </p:dialog>
  44.  
  45. @ManagedBean(name = "sessionBean")
  46. @SessionScoped
  47. public class SessionBean implements Serializable{
  48.  
  49. private Utente utente;
  50.  
  51. public Utente getUtente() {
  52. return utente;
  53. }
  54.  
  55. public void setUtente(Utente utente) {
  56. this.utente = utente;
  57. }
Add Comment
Please, Sign In to add comment