Create application clients
Application clients are the client applications that use a servlet to communicate with an enterprise bean, with the servlet residing on the same machine as an application server.
Before you begin
This article assumes that you have created and unit tested an application client program that you want to assemble in an enterprise application and deploy onto an application server.
Overview
Application clients consist of several models. This article applies to application clients based on the J2EE model.A J2EE application client is a Java application program that accesses enterprise beans, Java DataBase Connectivity (JDBC) application programming interfaces, and Java Message Service (JMS) message queues. The J2EE application client program runs on networked client systems. The program follows the same Java programming model as other Java programs; however, the J2EE application client depends on the application client run time to configure its execution environment, and uses the Java Naming and Directory Interface (JNDI) name space to access resources.
Use a J2EE application client to develop an application program, assemble the program into an application client project, deploy the project as a client application (JAR file), and launch the client application.
To create a deployable client application, use an Application Server Toolkit (AST) or Rational Web Developer assembly tool to create and add an application client project to a new or existing enterprise application project.
Procedure
- Start an assembly tool.
- If you have not done so already, configure the assembly tool for work on J2EE modules. Ensure that the J2EE capability is enabled.
- Click File > New > Project > J2EE > Application Client Project > Next. Or, if you have created a J2EE project before, click File > New > Application Client Project.
- In the New Application Client Project dialog:
- Name the application client project and specify its location. To change the default project location, click Browse and specify a new location. If you specify a non-default project location that is already being used by another project, one cannot create the project.
- Click Show Advanced to display hidden settings.
- Select the J2EE specification version to which you want your project to adhere.
- Select a target server. Select the WAS v6.0 target server to use V6 WebSphere Application Server capabilities.
- If you want to add application client components to an enterprise application (EAR file), select Add module to an EAR project.
- Specify a new or existing enterprise application (EAR) project to be associated with your new application client project for purposes of deployment. Select an existing enterprise application project from the drop-down list or type a new project name. Or, click New and create a new enterprise application.
Note that if you type a new EAR project name, the EAR project is created in the default location with the lowest compatible J2EE version based on the version of the project being created. If you want to specify a different version or a different location for the enterprise application, click New and create a new enterprise application.
- Specify whether you want to create a default Main class.
- Optional: If you are creating a new enterprise application project or if you have no module dependencies to specify, skip this step. Otherwise, click Next to specify module and JAR file dependencies. On the Module Dependencies page, select dependent JAR files or modules within the associated enterprise application project. This updates the runtime class-path and Java project build path with the appropriate JAR files. Application client modules, EJB modules, and Web modules can all have dependencies on EJB modules or utility JAR files. Modules cannot depend on WAR or application client JAR files.
- Click Finish.
Result
A new application client project is created, reflecting the J2EE folder structure that specifies the location of application client content files, class files, class paths, the deployment descriptor, and supporting metadata. Files for the application client project are shown in the Project Explorer view under Enterprise Applications and Application Client Projects.
What to do next
After creating an application client project, one can edit the application client deployment descriptor if default properties are not sufficient. In the Client Deployment Descriptor editor, one can add enterprise bean, resource, or resource environment references as well as view and edit source code.For more information, see the online help for the assembly tool. Similar information is in the Application Server Toolkit information center available with this information center. Click Application Server Toolkit > J2EE applications > Defining J2EE application clients.
See Also
Application Client for WebSphere Application Server
Enterprise (J2EE) applications
Related Tasks
Assembling application clients
Assembling applications
Creating enterprise applications
Related Information
Import client applications