conexión a los FacadeRemote de los EJB. Mejoras en el login de usuario. Corregido problema en registro de usuario.
51 lines
1.2 KiB
Java
51 lines
1.2 KiB
Java
package managedbean.profile;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.Properties;
|
|
|
|
import javax.ejb.EJB;
|
|
import javax.enterprise.context.RequestScoped;
|
|
import javax.inject.Named;
|
|
import javax.naming.Context;
|
|
import javax.naming.InitialContext;
|
|
|
|
import ejb.profile.ProfileFacadeRemote;
|
|
import managedbean.common.ManagedBeanBase;
|
|
|
|
/***
|
|
*
|
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
|
*
|
|
*/
|
|
@Named( "ShowSpecialistDoctorMBean")
|
|
@RequestScoped
|
|
public class ShowSpecialistDoctorMBean extends ManagedBeanBase implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
@EJB
|
|
private ProfileFacadeRemote remoteManager;
|
|
|
|
/**
|
|
* Constructor. Inicializa la conexión con el EJB Remoto
|
|
*
|
|
* @throws Exception
|
|
*/
|
|
public ShowSpecialistDoctorMBean() throws Exception {
|
|
initializeAdminFacadeRemote();
|
|
}
|
|
|
|
/**
|
|
* Inicializa la conexión con el EJB Remoto
|
|
*
|
|
* @throws Exception
|
|
*/
|
|
private void initializeAdminFacadeRemote() throws Exception {
|
|
Properties props = System.getProperties();
|
|
Context ctx = new InitialContext(props);
|
|
remoteManager = (ProfileFacadeRemote) ctx
|
|
.lookup("java:app/myHealth.jar/ProfileFacadeBean!ejb.component.ProfileFacadeRemote");
|
|
}
|
|
|
|
}
|