All Examples All WebLogic Enterprise Connectivity Examples
WebLogic Enterprise Connectivity JSP Stateless Session Bean Example
examples.wlec.jsp.statelesssessionbean
About This Example
This example demonstrates how to use WebLogic Enterprise Connectivity (WLEC) to access a WebLogic EnterpriseTM (WLE) Enterprise Java Bean (EJB) from a JavaServer Page (JSP) on WebLogic ServerTM (WLS). The example combines a WLS JSP and the WLE Stateless Session Bean example.
The following figure illustrates the WLEC JSP Stateless Session Bean example.
When you run the WLEC JSP Stateless Session Bean example, the following events occur:
The remaining steps are performed at run time.
How To Use This Example
This section describes how to set up and run the JSP Stateless Session Bean example.
Prerequisites
Install and set up the following:
See Platform Support for WebLogic Enterprise Connectivity for information about the supported versions for each of these products.
Setting Up the Example
See the Stateless Session Bean Sample Application in the WLE documentation:
The build procedure for the Stateless Session Bean sample generates the ejb_basic_statelessSession.jar file. This .jar file contains the stubs, skeletons, and classes necessary for the JSP to act as a client to the Stateless Session Bean sample.
WEBLOGIC_CLASSPATH is an environment variable in the startWebLogic.cmd file (NT) or the startWebLogic.sh file (UNIX).
You can uncomment and edit the weblogic.CORBA.connectionPool.StatelessSessionpool property in the weblogic.properties file. See Setting Up WebLogic Enterprise Connectivity.
weblogic.httpd.register.*.jsp=\
weblogic.servlet.JSPServlet
weblogic.httpd.initArgs.*.jsp=\
pageCheckSeconds=1,\
compileCommand=c:/java/bin/javac.exe,\
workingDir=/weblogic/myserver/classfiles,\
verbose=true
Make sure compileCommand points to a valid Java compiler. See Setting Up WebLogic JSP in the Administrator's Guide.
weblogic.httpd.documentRoot=public_html
The JSP file must be in a directory that is below the document root directory. The document root is the top level directory for files that are publicly available on WLS. It is the root directory from which WLS looks for JSP files. See Setting Up the Document Root.
On Windows NT:
%WL_HOME%\myserver\public_html\jsp
On UNIX:
$WL_HOME/myserver/public_html/jsp
Running the Example
If you are going to start WLS by running startweblogic, set JAVACLASSPATH in the startweblogic.cmd file (NT) or the startweblogic.sh file (UNIX). Otherwise, set JAVACLASSPATH by means of another method such as the command line or the NT System Properties dialog.
If you are going to start WLS by running startweblogic, set WEBLOGIC_CLASSPATH in the startweblogic.cmd file (NT) or the startweblogic.sh file (UNIX). Otherwise, set WEBLOGIC_CLASSPATH by means of another method such as the command line or the NT System Properties dialog.
For information about setting classpaths for WLS, see Setting Up and Starting WebLogic Server.
http://localhost:7001/jsp/statelessSessionBean.jsp
The JSP servlet provides the required inputs to the EJB. The inputs consist of a customer name, number of shares, stock symbol, and type of trade (buy or sell) for a number of transactions.
Related Documents
For information about WLS JSPs:
For information about WLE EJBs:
For information about the WLE Stateless Session Bean example:
See also Using WebLogic Enterprise Connectivity.
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|