Example of retrieving / getting the named object from JNDI or JSF

From JNDI:

private ContractSchedulezFacade lookupFacade() {
        try {
            Context c = new InitialContext();
            return (Facade) c.lookup("java:app/i88-ejb/Facade!ca.i88.facade.Facade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);

From FacesContext if using JSF:

Controller controller = (Controller) facesContext.getApplication().getELResolver().
                    getValue(facesContext.getELContext(), null, "controller");


Popular posts from this blog

How to get Active Transactions and Locks from MySQL

Example of a PAC file