<%@ page import="hello.Hello, oracle.aurora.jndi.sess_iiop.ServiceCtx, javax.naming.Context, javax.naming.InitialContext, java.util.Hashtable" %> The CallCORBA JSP
<% String surl = request.getParameter("surl"); String inJServer = System.getProperty("oracle.jserver.version"); if ((surl != null) || (inJServer != null)) { %>

           <%= doCallCORBA(surl, inJServer) %>
        


<% } if (inJServer == null) { // not running in JServer, ask for a CORBA service URL %>

Enter a CORBA service URL:

<% } %> <%! private String doCallCORBA(String serviceURL, String inJServer) { Context ic = null; Hello hello = null; try { if (inJServer != null) { // use simplified and optimized lookup in JServer ic = new InitialContext(); hello = (Hello) ic.lookup("/test/myHello"); } else if (serviceURL != null) { // not running in JServer, use standard lookup Hashtable env = new Hashtable(); env.put(Context.URL_PKG_PREFIXES, "oracle.aurora.jndi"); env.put(Context.SECURITY_PRINCIPAL, "scott"); env.put(Context.SECURITY_CREDENTIALS, "tiger"); env.put(Context.SECURITY_AUTHENTICATION, ServiceCtx.NON_SSL_LOGIN); ic = new InitialContext (env); hello = (Hello)ic.lookup (serviceURL + "/test/myHello"); } return ("Hello, I'm a CORBA object in Oracle 8i.\n" + hello.helloWorld()); } catch (Exception e) { return "Error occurred: " + e; } } %>