All Examples  All WebLogic Enterprise Connectivity Examples

package examples.wlec.servlets.simpapp

WebLogic Enterprise Connectivity servlet simpapp example

Class Index

  • SimpappServlet
  • About this example

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

    1. At startup:

      The remaining steps are performed at run time.

    2. 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 Platform Support for WebLogic Enterprise Connectivity for information about the supported versions for each of these products.

    Setting up the example

    1. Build and run the WebLogic Enterprise Simpapp sample.

      See the Java Simpapp Sample Application in the WebLogic Enterprise documentation. If you are viewing this document on the Web, see the WebLogic Enterprise documentation on the Web. If you are viewing this document from the documentation CD, see the WebLogic Enterprise documentation on the CD. To get to the Java Simpapp Sample Application, click J2EE Topics, scroll down and click Sample Applications, then click Java Simpapp Sample Application.

      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. If you are viewing this document on the Web, see the WebLogic Enterprise documentation on the Web. If you are viewing this document from the documentation CD, see the WebLogic Enterprise documentation on the CD. To get to Creating CORBA Client Applications, click CORBA Topics, then scroll down and click Creating CORBA Client Applications.

      WebLogic Enterprise provides the idltojava compiler. You must run the idltojava compiler on a computer with a C++ development environment, because 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 compiled WebLogic Enterprise Simpapp client stubs to your WebLogic Server SERVER_CLASSES directory. The files you need to copy are:

    4. Compile SimpappServlet.java with one of the following commands.

      On Windows NT:

          javac -d %SERVLET_CLASSES% SimpappServlet.java

      On UNIX:

          javac -d $SERVLET_CLASSES$ SimpappServlet.java

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

    6. Register the servlet 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

      Additionally, to let everyone request HTML files via the servlet, add the following line to the weblogic.properties file:

      weblogic.allow.execute.servlet.file=everyone

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

    7. Initialize an IIOP connection pool by modifying the weblogic.properties file.

      You can uncomment and edit the weblogic.CORBA.connectionPool.simplepool property in the weblogic.properties file. See the Administrators Guide Setting up WebLogic Enterprise Connectivity.

    Running the example

    1. If you are using Java 2, Version 1.2, make sure that the Java system classpath in your server shell includes ./lib/poolorb.jar.

      Add this .jar file to the JAVACLASSPATH environment variable in the startWebLogic.cmd file (NT) or the startWebLogic.sh file (UNIX).

    2. Start WebLogic Server in your server shell.

    3. Start a Web browser and enter the URL for Simpapp.html. For example:

      http://localhost:7001/Simpapp.html

    4. On the HTML form:

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

    There's more...

    Read more about configuring and using WebLogic Enterprise Connectivity in:

    Copyright © 2000 BEA Systems, Inc. All rights reserved.
    Last updated 3/8/00