Previous Next vertical dots separating previous/next from contents/index/pdf

The Samples Workspace

You'll find a variety of sample workspaces installed with Workshop for WebLogic here:

     BEA_HOME/workshop_10.0/ workshop4WP/eclipse/plugins/com.bea.workshop.product.wl.samples_1.0.0/workspaces

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.

For instructions on opening any of the these sample workspaces, see Opening a Sample Workspace.

The SamplesWorkspace contains the following samples. (For information on the tutorial-based samples, see Tutorial-based Samples.)

Control Samples

Database Control: Customer

Custom Control: Customer

Custom Control: Hello World

Web Service Controls (see Web Service samples below)

Web Application Samples

Hello World Web

Customer Web

FormBean Web

Web Service Samples

Synchronous Hello World

Asynchronous Hello World

Secure News Service

JSP Template Project Sample

JSP Template Project

Control Samples

Database Control: Customer

Demonstrates a Beehive database system control. This control performs basic operations on a database: select, insert, update and delete.

Sample Files

File Role in Sample
SharedControls/src/database/CustomerDBControl.java

Contains methods that create and query the data table PK_CUSTOMER.

This control is used by the Customer Web sample to retrieve customer data. It also works in concert with the Customer Custom Control.

This control extends the Beehive DB system 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: 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.

Running the Sample

  1. Open the SamplesWorkspace according to these instructions.
  2. Right-click on WebApps/src/helloWorld/HelloWorldController.java and select Run As > Run on Server.
  3. 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.
  4. 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.

Running the Sample

  1. Open the SamplesWorkspace according to these instructions.
  2. Right-click on WebApps/src/database/DatabaseController.java and select Run As > Run on Server.
  3. 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.
  4. 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.
WebApps/WebContent/formbean/index.jsp

Displays the multi-select form to the user.

Running the Sample

  1. Open the SamplesWorkspace according to these instructions.
  2. Right-click on WebApps/src/formbean/FormBeanController.java and select Run As > Run on Server.
  3. 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.

Sample Files

File Role in Sample
WebServiceClients/src/clients/HelloWorldControlClient.java Client web service for HelloWorld.java (via the intermediary control HelloWorldServiceControl.java)
WebServiceClients/src/controls/HelloWorldServiceControl.java Intermediary control between HelloWorldControlClient.java and HelloWorld.java
WebServices/src/services/HelloWorld.java Base web service for this sample.

Running the Sample

  1. Open the SamplesWorkspace according to these instructions.
  2. Right-click on WebServiceClients/src/clients/HelloWorldControlClient.java and select Run As > Run on Server.
  3. 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.
  4. In the WebLogic Test Client, click getHelloWorldMessage.

Asynchronous Hello World

Demonstrates an asynchronous web service, web service control, and client.

Sample Files

File Role in Sample
WebServiceClients/src/clients/HWCallbackClient.java Client web service for HWCallback.java (via the intermediary control HWCallbackServiceControl.java)
WebServiceClients/src/controls/HWCallbackServiceControl.java Intermediary control between HWCallbackClient.java and HWCallback.java
WebServices/src/services/HWCallback.java Base web service for this sample.

Running the Sample

  1. Open the SamplesWorkspace according to these instructions.
  2. Right-click on WebServiceClients/src/clients/HWCallbackClient.java and select Run As > Run on Server.
  3. 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.
  4. 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.

Sample Files

File Role in Sample
WebServiceClients/src/clients/security/NewsServiceControlCaller.java Client web service for SecureNewsService.java (via the intermediary control NewsServiceControl.java)
WebServiceClients/src/controls/NewsServiceControl.java Intermediary control between NewsServiceControlCaller.java and SecureNewsService.java
WebServiceClients/src/controls/secureCallbackServerNewsServiceService.wsdl WSDL for the web service SecureNewsService.java
WebServices/src/services/security/SecureNewsService.java Base web service for this sample.

Running the Sample

  1. Open the SamplesWorkspace according to these instructions.
  2. Right-click on WebServiceClients/src/clients/security/NewServiceControlCaller.java and select Run As > Run on Server.
  3. 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.
  4. 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.

Related Topics

Opening a Sample Workspace

 

Skip navigation bar   Back to Top