Cambio en la descripción de PDS MyHealth a MyHealth
Configuración de regla de navegación para JSF. Pruebas con primefaces Nuevo ManagedBean para pantalla home. Pagina de login para pruebas.
This commit is contained in:
10
1.sources/MyHealth/src/common/ApplicationConfig.java
Normal file
10
1.sources/MyHealth/src/common/ApplicationConfig.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package common;
|
||||
|
||||
import javax.enterprise.context.ApplicationScoped;
|
||||
import javax.faces.annotation.FacesConfig;
|
||||
|
||||
@FacesConfig
|
||||
@ApplicationScoped
|
||||
public class ApplicationConfig {
|
||||
|
||||
}
|
||||
28
1.sources/MyHealth/src/common/homeMBean.java
Normal file
28
1.sources/MyHealth/src/common/homeMBean.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package common;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.faces.bean.ManagedBean;
|
||||
import javax.faces.bean.SessionScoped;
|
||||
|
||||
/***
|
||||
*
|
||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@ManagedBean(name = "home")
|
||||
@SessionScoped
|
||||
public class homeMBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String getUserName() {
|
||||
return SessionUtils.getSession().getAttribute("username").toString();
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return (String) SessionUtils.getSession().getAttribute("userid");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package managedbean.profile;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.ejb.EJB;
|
||||
import javax.naming.Context;
|
||||
import javax.naming.InitialContext;
|
||||
|
||||
import ejb.profile.ProfileFacadeRemote;
|
||||
|
||||
public class ProfileMBeanBase {
|
||||
@EJB
|
||||
protected ProfileFacadeRemote remoteManager;
|
||||
|
||||
protected void initializeProfileFacadeRemote() throws Exception {
|
||||
Properties props = System.getProperties();
|
||||
Context ctx = new InitialContext(props);
|
||||
remoteManager = (ProfileFacadeRemote) ctx.lookup("java:app/MyHealth.jar/ProfileFacadeBean!ejb.profile.ProfileFacadeRemote");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user