# Working with Java Controls

WebLogic Workshop provides Java controls that make it easy for you to encapsulate business logic and to access enterprise resources such as databases, legacy applications, and web services. There are three different types of Java Controls: built-in Java controls, portal controls, and custom Java controls.

Built-in controls provide easy access to enterprise resources. For example, the Database control makes it easy to connect to a database and perform operations on the data using simple SQL statements, whereas the EJB control enables you to easily access an EJB. Built-in controls provide simple properties and methods for customizing their behavior, and in many cases you can add methods and callbacks to further customize the control.

A portal control is a kind of built-in Java control specific to the portal environment. If you are building a portal, you can use portal controls to expose tracking and personalization functions in multi-page portlets.

You can also build your own custom Java control from scratch. Custom Java controls are especially powerful when used to encapsulate business logic in reusable components. It can act as the nerve center of a piece of functionality, implementing the desired overall behavior and delegating subtasks to built-in Java controls (and/or other custom Java controls). This use of a custom Java control ensures modularity and encapsulation. Web services, JSP pages, or other custom Java controls can simply use the custom Java control to obtain the desired functionality, and changes that may become necessary can be implemented in one software component instead of many.

If you are connecting to an enterprise resource that exposes a standards-based, J2EE, or Web Services interface, you can create a custom Java control to directly connect to that application. However, if you are connecting to an external resource that is proprietary or does not expose standard J2EE APIs, you may need to use a JCA (Java Connector Architecture) adaptor and an Application View control rather than a Java control to connect to that resource. JCA adaptors and the Application View control are available through WebLogic Integration. For more information on using JCA adaptors and the Application View control, see Overview: Application Integration.

## Topics Included in This Section

Getting Started with Java Controls

Provides an overview of Java controls.

Invoking a Control Method

Describes how to invoke a control method from another software component.

Handling Control Callbacks

Describes how to implement a callback handler.

Handling Control Method Exceptions

Discusses how to handle exceptions that may be thrown by your control.

Using Built-In Controls

Describes the Java controls that WebLogic Workshop provides for you to connect to databases, set timers, send messages, and perform other common tasks.

Building Custom Controls

Explains how to create Java controls to use in your projects and applications.

Adding Portal Controls to Java Page Flows

Introduces Portal controls and provides links to other portal topics to help you work with them.

Related Topics

Getting Started: Java Controls

This tutorial provides a quick introduction to developing Java Controls.