private String jndiFactoryClass; (Web hosting ecommerce) private String jndiURL; private Context
private String jndiFactoryClass; private String jndiURL; private Context initCtx = null; public JNDIConnectorPlugin( ) { super( ); } public void init(ActionServlet servlet, ApplicationConfigconfig) throws ServletException{ // Get the host and port where the JNDI service isrunningjndiFactoryClass = servlet.getInitParameter(”jndifactory-class”); jndiURL = servlet.getInitParameter(”jndi-url”); try{ Hashtable props = new Hashtable( ); // The EJB spec also allows these to be read from the jndi.properties fileprops.put( Context.INITIAL_CONTEXT_FACTORY, jndiFactoryClass ); props.put( Context.PROVIDER_URL, jndiURL ); initCtx = new InitialContext(props); }catch( Exception ex ){ throw new ServletException( ex ); } // Store the JNDI Context into the ServletContext servlet.getServletContext( ).setAttribute( “Storefront.InitCtx”, initCtx ); } public void destroy( ){ try{ if ( initCtx != null ){ initCtx.close( ); initCtx = null; // No need to remove from ServletContext because app is being shut down} }catch( Exception ex ){ ex.printStackTrace( ); } } }
From our experience, we can recommend PHP Web Hosting services, if you need affordable webhost to host and run your web application.