PK m< META-INF/PK l< -jjMETA-INF/MANIFEST.MFManifest-Version: 1.0 Ant-Version: Apache Ant 1.7.1 Created-By: 1.5.0_22-b03 (Sun Microsystems Inc.) PK m<WEB-INF/PK m<WEB-INF/classes/PK m< WEB-INF/lib/PK m<р4WEB-INF/lib/gfv3remotestub.jarPK< META-INF/PKPK<META-INF/MANIFEST.MFMLK-. K-*ϳR03r.JM,IMu *h)f&W+x%irrPKTGGPKF<org/test/ejb/GFRemote.classeOJ@ }٭"e=yY/ ާ%) dE̓GiE %佗Ϸw8*pX`A&J8;m5Jt?"BlJR|,$yBS ̷ak^ \f蒫:>/|$pj>0$)r_9}̵9PK ɟ$PK< META-INF/PK /gfv3orbclient Keep a copy of the generated servlet class' java code. PK m<,WEB-INF/web.xml 30 index.jsp PK m <%@ page import="org.test.ejb.*" %> <%@ page import="javax.sql.*,java.sql.*" %> <%@ page import="javax.transaction.*" %> <%@ page import="java.io.*,java.util.*,javax.servlet.*,javax.naming.*,javax.rmi.PortableRemoteObject,javax.ejb.*" %> Test page
 <%
     String passwd = request.getParameter("password");
     if (passwd == null) passwd = "password";
     String user = request.getParameter("user");
     if (user == null) user  = "admin";
     String origrealm = request.getParameter("realm");
     String realm = origrealm;
     if ("".equals(realm)) realm=null;
     String host = request.getParameter("host");
     if (host == null) host = "localhost";
     String port = request.getParameter("port");
     if (port == null) port = "3700";
     try {
            com.sun.appserv.security.ProgrammaticLogin plogin
              = new com.sun.appserv.security.ProgrammaticLogin();
            if (!plogin.login(user, passwd,
                    realm, request, response,true)) {
                out.println("WebProgrammaticLogin login error");
            } else {
                out.println("WebProgrammaticLogin login ok.");
            }
     } catch (Exception ex) {
            ex.printStackTrace(new PrintWriter(out, true));
     }
     GFRemote local = null;
     InitialContext initContext = null;
     out.println("Realm: "+realm);
     out.println("Retrieving JNDI initial context");
     try {
        Properties props = new Properties();
        props.setProperty("java.naming.factory.initial",
                "com.sun.enterprise.naming.impl.SerialInitContextFactory");
        props.setProperty("java.naming.factory.url.pkgs",
                "com.sun.enterprise.naming");
        props.setProperty("java.naming.factory.state",
                "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
        props.setProperty("org.omg.CORBA.ORBInitialHost",
                host);
        props.setProperty("org.omg.CORBA.ORBInitialPort",
                port);
        initContext = new javax.naming.InitialContext(props);
     } catch (Exception e) {
        out.println("Exception creating InitialContext: " + e.toString());
        return;
     }
     String JNDIName = "ejb/GFRemote";
     try {
        String ejbname = request.getParameter("ejbname");
        if (null!=ejbname && ejbname.trim()!="") {
            JNDIName = ejbname;
        }
        if (null != request.getParameter("test")) {
            out.println("Looking up: " + JNDIName);
            local  = (GFRemote)initContext.lookup(JNDIName);
            out.println("Local: "+local);
            out.println("Result: "+local.say("Run ok"));
        }
     } catch(Exception e) {
        out.println("Error:  " + e.toString());
        e.printStackTrace(new java.io.PrintWriter(out,true));
        return;
     }
 %>
     
User:
Pass:
Realm: " size="10" />
Host:
Port:
JNDI:
Test:
PK m< AMETA-INF/PK l< -jj+META-INF/MANIFEST.MFPK m<AWEB-INF/PK m<AWEB-INF/classes/PK m< AWEB-INF/lib/PK m<р4EWEB-INF/lib/gfv3remotestub.jarPK m