All Examples All WebLogic Enterprise Connectivity Examples
package examples.wlec.servlets.university

WebLogic Enterprise Connectivity servlet university example
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. The example uses WebLogic JHTML and the WebLogic PageCompileServlet.
- At startup:
- The WebLogic Server creates a connection pool for the University domain.
- The University servlet's init method obtains a connection from the connection pool.
- At runtime, the HTML client sends a request and input string to a JHTML servlet:
- Before sending the request, the HTML client might use an additional HTML file to request and retrieve input data.
- The PageCompileServlet creates the JHTML servlet by compiling a JHTML file into a Java HTTP servlet. (For more information about JHTML and the PageCompileServlet, see Using WebLogic JHTML.)
- Acting as a WebLogic Enterprise client, the JHTML servlet:
- Activates the connection to the University domain.
- Invokes the desired operation on the University object with the data that it received from the HTML client.
- The University object performs the specified operation and returns the results to the JHTML servlet. The University object can perform the following operations:
- Display a list of all the courses.
- Display a list of courses based on a search string.
- Display information about a course.
- Register a student for a course.
- Display a list of registered courses for a student.
- The PageCompileServlet 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 for each of
these products.
Setting up the example
- Build and run the WebLogic Enterprise University Transactions sample.
See The
Transactions Sample Application in the WebLogic
Enterprise documentation.
You can optionally use the C++ version of the 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 .idl files 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.
- Set up your development environment as described in
Setting your development environment.
- Copy the WebLogic Enterprise Transactions University client stubs to
your WebLogic Server SERVER_CLASSES directory, with a command like this
one for Windows NT:
$ COPY univ_dir/transactions/UniversityT/*.class %SERVER_CLASSES%
where univ_dir is the location of the WebLogic Enterprise University sample.
- Compile UniversityServlet.java with
a command like this one for Windows NT:
$ javac -d %SERVLET_CLASSES% *.java
- Copy the .html and .jhtml files into your registered document root, which defaults to myserver/public_html.
- Initialize an IIOP session pool by modifying the weblogic.properties file.
See
the Administrators Guide Setting up WebLogic
Enterprise Connectivity. You can uncomment and edit the weblogic.CORBA.connectionPool.Univpool property in
the weblogic.properties file.
- Set up JHTML by modifying the weblogic.properties file.
For information about configuring JHTML and the weblogic.properties file, see the Service-related
properties in the WebLogic Administrators Guide.
Running the example
- Start the WebLogic Server in your server shell.
- Start a Web browser and enter the URL for UniversityForm.html, for example http://localhost:7001/UniversityForm.html.
- On the HTML form:
- Choose an operation.
- Fill in the form.
- Submit the form.
- Watch for the results.
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/15/1999