The Workshop Samples Application contains a variety of code
samples and mini-applications built with Workshop.
Opening the Sample Application
To open the sample, select File > New > Example.
In the New Example wizard select Workshop WebLogic/Beehive Examples
> Workshop Samples Application and click Next > Finish.
Sample Contents
The SamplesWorkspace contains the following samples. (For information on
the tutorial-based samples, see Tutorial-based
Samples.)
This sample cannot be run independently. Instead run the Customer
Web sample to invoke the methods on this control.
Custom Control: Customer
Demonstrates a basic custom control. This control mediates between the Customer
Web sample and the Customer database control because its methods wrap the
database control methods.
Sample Files
File
Role in Sample
SharedControls/src/database/Customer.java
A JavaBean that defines the data structure for the Customer
object.
A Customer object instance corresponds to an individual record
in the PK_CUSTOMER data table.
An array of Customer objects corresponds to a record set
from the PK_CUSTOMER data table.
SharedControls/src/database/CustomerControl.java
The control interface for the Customer control. Contains
wrapper methods for the Customer Database
Control. These methods perform basic database operations:
select, update, insert and delete.
SharedControls/src/database/CustomerImpl.java
The control implementation for the Customer control.
Running the Sample
This sample cannot be run independently. Instead run the Customer
Web sample to invoke the methods on this control.
Custom Control: Hello World
Demonstrates a simple custom control with one 'Hello World' method.
Sample Files
File
Role in Sample
SharedControls/src/hello/Hello.java
The control interface class.
Contains a single method signature: String hello();
SharedControls/src/hello/HelloWorld.java
The control implementation class.
Running the Sample
This sample cannot be run independently. Instead run the Hello
World Web sample to invoke the methods on this control.
Web Application Samples
Hello World Web
Demonstrates a simple web application. This web application contains one
page flow (= a controller class + JSP pages). The page flow invokes the Hello
World control and displays the result.
Sample Files
File
Role in Sample
WebApps/src/helloWorld/HelloWorldController.java
The controller class. This controller class contains one
action method, begin(). This method invokes the Hello
World control, places the result of the invocation in
a action output, and forwards to the index.jsp page.
WebApps/WebContent/helloWorld/index.jsp
This JSP displays the result of the Hello World control
invocation. The result data is passed to the page through
an action output/page input.
Right-click on WebApps/src/helloWorld/HelloWorldController.java and select
Run As > Run on Server.
If you have not already set up a server, follow these instructions:
In the Run On Server dialog, select Manually define
a new server, confirm that the node BEA Systems >
BEA WebLogic v10.0 Server is selected and click Next.
In the dropdown Domain home select <BEA_HOME>/wlserver_10.0/samples/domains/workshop_10.1
where <BEA_HOME> is the root directory of your installation.
Click Finish.
If you have already set up a server, follow these instructions:
In the Run On Server dialog, confirm that the node localhost
> BEA WebLogic v10.0 Server is selected and click
Finish.
The index.jsp page will display the results of calling the Hello World
control.
Customer Web
Demonstrates a customer data management web application. This web application
allows web access to a customer database.
Sample Files
File
Role in Sample
WebApps/src/database/DatabaseController.java
The controller class. This controller class contains
one action method, getCustomers(). This method invokes the
Customer control, places the
result of the invocation in a action output, and forwards
to the index.jsp page.
WebApps/WebContent/database/index.jsp
This JSP displays the result of the Customer control
invocation. The result data (a record set from a database)
is passed to the page through an action output/page input.
Right-click on WebApps/src/database/DatabaseController.java and select
Run As > Run on Server.
If you have not already set up a server, follow these instructions:
In the Run On Server dialog, select Manually define
a new server, confirm that the node BEA Systems >
BEA WebLogic v10.0 Server is selected and click Next.
In the dropdown Domain home select <BEA_HOME>/wlserver_10.0/samples/domains/workshop_10.1
where <BEA_HOME> is the root directory of your installation.
Click Finish.
If you have already set up a server, follow these instructions:
In the Run On Server dialog, confirm that the node localhost
> BEA WebLogic v10.0 Server is selected and click
Finish.
The index.jsp page will display the results of calling the Customer
control.
FormBean Web
Demonstrates how to submit a multi-selectable list using a form bean.
Sample Files
File
Role in Sample
WebApps/src/formbean/FormBeanController.java
The controller class. This controller class contains
the action method displayChoice() that handles the user
submit.
WebApps/WebContent/formbean/display.jsp
Displays the items selected by the user after submission.
Right-click on WebApps/src/formbean/FormBeanController.java and select
Run As > Run on Server.
If you have not already set up a server, follow these instructions:
In the Run On Server dialog, select Manually
define a new server, confirm that the node BEA Systems >
BEA WebLogic v10.0 Server is selected and click Next.
In the dropdown Domain home select <BEA_HOME>/wlserver_10.0/samples/domains/workshop_10.1
where <BEA_HOME> is the root directory of your installation.
Click Finish.
If you have already set up a server, follow these instructions:
In the Run On Server dialog, confirm that the node localhost
> BEA WebLogic v10.0 Server is selected and click
Finish.
Web Service Samples
Synchronous Hello World
Demonstrates a simple, synchronous web service, web service control, and
client.
Right-click on WebServiceClients/src/clients/HelloWorldControlClient.java
and select Run As > Run on Server.
If you have not already set up a server, follow these instructions:
In the Run On Server dialog, select Manually
define a new server, confirm that the node BEA Systems > BEA WebLogic v10.0 Server is selected
and click Next.
In the dropdown Domain home select <BEA_HOME>/wlserver_10.0/samples/domains/workshop_10.1
where <BEA_HOME> is the root directory of your installation.
Click Finish.
If you have already set up a server, follow these instructions:
In the Run On Server dialog, confirm that the node
localhost > BEA WebLogic v10.0 Server
is selected and click Finish.
In the WebLogic Test Client, click getHelloWorldMessage.
Asynchronous Hello World
Demonstrates an asynchronous web service, web service control, and client.
Right-click on WebServiceClients/src/clients/HWCallbackClient.java
and select Run As > Run on Server.
If you have not already set up a server, follow these instructions:
In the Run On Server dialog, select Manually define
a new server, confirm that the node BEA Systems >
BEA WebLogic v10.0 Server is selected and click Next.
In the dropdown Domain home select <BEA_HOME>/wlserver_10.0/samples/domains/workshop_10.1
where <BEA_HOME> is the root directory of your installation.
Click Finish.
If you have already set up a server, follow these instructions: In
the Run On Server dialog, confirm that the node localhost
> BEA WebLogic v10.0 Server is selected and click Finish.
In the WebLogic Test Client, enter a value in the
name field and click start.
Secure News Service
Demonstrates a secure asynchronous web service, web service control,
and client. Features role-based access filters and a secure callback from
the base web service to the client.
Right-click on WebServiceClients/src/clients/security/NewServiceControlCaller.java
and select Run As > Run on Server.
If you have not already set up a server, follow these
instructions: In the Run On Server dialog, select
Manually define a new server, confirm that the node
BEA Systems > BEA WebLogic v10.0 Server
is selected and click Next.
In the dropdown Domain home select <BEA_HOME>/wlserver_10.0/samples/domains/workshop_10.1
where <BEA_HOME> is the root directory of your installation.
Click Finish.
If you have already set up a server, follow these instructions:
In the Run On Server dialog, confirm that the node
localhost > BEA WebLogic v10.0 Server
is selected and click Finish.
In the WebLogic Test Client, enter the username/password
pair weblogic/weblogic and click subscribeToNews.