All Examples  All WebLogic Enterprise Connectivity Examples

package examples.wlec.servlets.simpapp

Class Index

WebLogic Enterprise Connectivity servlet simpapp example

  • SimpappServlet
  • about this example

    This example demonstrates how to use WebLogic Enterprise Connectivity to access a WebLogic Enterprise CORBA object from a servlet on a WebLogic Server.

    1. At startup:

    2. At runtime, the HTML client sends a request and input string to the servlet.

    3. Acting as a WebLogic Enterprise client, the servlet's service method:

    4. The Simple object performs the specified operation and returns the results to the Simpapp servlet. The Simple object can perform two operations:

    5. The Simpapp servlet compiles the results into a dynamically generated HTML page and sends the page to the HTML client.

    how to use this example

    Prerequisites

    Install and set up WebLogic Server, JDK, and WebLogic Enterprise. See WebLogic platform support for information about the supported versions of each of these products.

    Setting up the example

    1. Build and run the WebLogic Enterprise Simpapp sample.

      See Java Simpapp Sample Application in the WebLogic Enterprise documentation. The build procedure for the Java version of the Simpapp sample generates the client stubs and puts them in your working directory. Client stubs provide the programming interface for CORBA object operations.

      You can use the C++ version of the Simpapp sample, which uses C++ client stubs instead of Java client stubs. If you use the C++ version, you must run the idltojava compiler on the simple.idl file to generate Java client stubs. For information about manually generating client stubs, see Creating CORBA Client Applications in the WebLogic Enterprise documentation. You can get the idltojava compiler from Sun's Java IDL Web page. The idltojava compiler must be run on a computer with a C++ development environment, since it runs the C precompiler on the .idl source.

    2. Set up your WebLogic Server development environment as described in Setting your development environment.

    3. Copy the WebLogic Enterprise Simpapp client stubs to your SERVER_CLASSES directory. Copy all of these files:

    4. Set up your WebLogic Server development environment as described in Setting your development environment.

    5. Compile the WebLogic Enterprise Connectivity Simpapp servlet Java class with a command like this one for Windows NT:
        $ javac -d %SERVLET_CLASSES% SimpappServlet.java

    6. Copy the file Simpapp.html into the registered document root, which defaults to myserver/public_html.

    7. Register SimpappServlet by adding the following properties to the weblogic.properties file:
        weblogic.httpd.register.SimpappServlet=\
          examples.wlec.servlets.simpapp.SimpappServlet
        weblogic.allow.execute.weblogic.servlet.SimpappServlet=everyone

      For information about the weblogic.properties file, see HTTP- and servlet-related properties in the WebLogic Administrators Guide.

    8. Set up an IIOP connection pool by adding to the weblogic.properties file a property similar to this one:
        weblogic.CORBA.connectionPool.simplepool=\
          domainname=simpapp,\
          appaddrlist=//hostname:port,\
          minpoolsize=2,\
          maxpoolsize=5

      See the Administrators Guide Setting up WebLogic Enterprise Connectivity.

    Running the example

      If you are using Java 2, Version 1.2, be sure that the Java system classpath in your server shell includes ./lib/poolorb.jar. In startWebLogic.sh the startWebLogic.cmd, you can add this .jar file to the JAVACLASSPATH environment variable.

    1. Start the WebLogic Server in your server shell.

    2. Start a Web browser and enter the URL for Simpapp.html, for example, http://localhost:7001/Simpapp.html.

    3. On the HTML form:

    4. Watch for the results. An uppercase string will convert to lowercase and vice versa.

    there's more...

    Read more about installing, configuring, and using WebLogic Enterprise Connectivity in:

    Copyright © 1999 BEA Systems, Inc. All rights reserved.

    Last updated 9/13/1999