diff --git a/1.sources/MyHealth/docroot/home.xhtml b/1.sources/MyHealth/docroot/home.xhtml
index 9384fd0..b2ce987 100644
--- a/1.sources/MyHealth/docroot/home.xhtml
+++ b/1.sources/MyHealth/docroot/home.xhtml
@@ -8,6 +8,9 @@
+
+ Logeado como:
+
@@ -22,32 +25,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/1.sources/MyHealth/src/managedbean/common/homeMBean.java b/1.sources/MyHealth/src/managedbean/common/homeMBean.java
index 89a2b55..216a2eb 100644
--- a/1.sources/MyHealth/src/managedbean/common/homeMBean.java
+++ b/1.sources/MyHealth/src/managedbean/common/homeMBean.java
@@ -4,8 +4,8 @@ import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
-import javax.enterprise.context.RequestScoped;
import javax.faces.application.FacesMessage;
+import javax.faces.view.ViewScoped;
import javax.inject.Named;
import common.UserType;
@@ -16,22 +16,23 @@ import common.UserType;
*
*/
@Named("home")
-@RequestScoped
+@ViewScoped
public class homeMBean extends ManagedBeanBase implements Serializable {
private static final long serialVersionUID = 1L;
private boolean isLogedIn;
private String userId;
private String userName;
+ private String userDisplayName;
private UserType userType;
- private int refresh;
@PostConstruct
public void init() {
- isLogedIn = SessionUtils.isLogedIn();
- userName = SessionUtils.getUserName();
- userId = SessionUtils.getUserId();
- userType = SessionUtils.getUserType();
+ this.isLogedIn = SessionUtils.isLogedIn();
+ this.userName = SessionUtils.getUserName();
+ this.userDisplayName = SessionUtils.getUserDisplayName();
+ this.userId = SessionUtils.getUserId();
+ this.userType = SessionUtils.getUserType();
FacesMessage message = SessionUtils.getMessage();
@@ -54,6 +55,13 @@ public class homeMBean extends ManagedBeanBase implements Serializable {
else
return this.userName;
}
+
+ public String getUserDisplayName() {
+ if (this.isLogedIn == false)
+ return "Invitado";
+ else
+ return this.userDisplayName;
+ }
public String getUserId() {
return this.userId;
@@ -63,14 +71,6 @@ public class homeMBean extends ManagedBeanBase implements Serializable {
return this.userType.getUserTypename();
}
- public int getRefresh() {
- return refresh;
- }
-
- public void setRefresh(int refresh) {
- this.refresh = refresh;
- }
-
public boolean isPatient() {
return (this.userType == UserType.PATIENT);
}