One of the workspaces, named SamplesWorkspace, contains a variety of code
samples and mini-applications built with Workshop for WebLogic. The remaining
workspaces are based on the Workshop for WebLogic Platform tutorials.
These tutorial-based samples
represent the completed applications that result when you finish one of the
tutorials.
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
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
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
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
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
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
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.
JSP Template Project Sample
JSP Template Project
Demonstrates the structure of a JSP template project. JSP template projects
are used to populate the list of available JSP/JSF
templates. For syntax rules for a JSP template project see Authoring
JSP Template Projects.
Sample Files
File
Role in Sample
TemplateProject/templateProject.xml
The template project configuration file. This file defines
one JSP template. (Note that Multiple templates may be defined.)
TemplateProject/images/
Image directory for the template.
TemplateProject/WebContent/index.jsp
The template page. This page is copied each time a new JSP
page is created and this template is selected.
Running the Sample
This sample cannot be run independently. See any of the JSP pages in the
WebApps project (inside WebApps/WebContent/) for examples of JSP pages created
with this template.
When you open the SamplesWorkspace, none of web application projects (WebApps,
WebServices, and WebServiceClients) use this template as their default JSP
template. To set this template project as the default JSP template for these
projects. Right-click one of the web projects and select Properties
> File Templates > Default JSP Template. Place a check mark
next to Use Project Settings and BEA Branded NetUI
JSP. Click OK.
The selected template will be applied whenever a new JSP file is created
by selecting New > Workshop JSP. Note that the template
is not applied when you select New > JSP.