Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void contextInitialized(ServletContextEvent event) {
- Properties props = new Properties();
- props.put("java.naming.factory.url.pkgs","org.jboss.ejb.client.naming");
- try {
- InitialContext ic = new InitialContext(props);
- String ejbUrl = "ejb:ShopEarFinal/ShopEarFrontControllerEJB//"+FrontController.class.getSimpleName()+"!"+FrontComponentRemote.class.getName();
- FrontComponentRemote frontController = (FrontComponentRemote) ic.lookup(ejbUrl);
- ServletContext context = event.getServletContext();
- context.setAttribute(FRONT_CONTROLLER_ATTRIBUTE, frontController);
- } catch (NamingException e) {
- e.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement