J2EE Application Development - PowerPoint PPT Presentation

About This Presentation
Title:

J2EE Application Development

Description:

J2EE Application Development B.Ramamurthy – PowerPoint PPT presentation

Number of Views:85
Avg rating:3.0/5.0
Slides: 13
Provided by: Bina5
Learn more at: https://cse.buffalo.edu
Category:

less

Transcript and Presenter's Notes

Title: J2EE Application Development


1
J2EE Application Development
  • B.Ramamurthy

2
Introduction
  • We will show how to develop, deploy and run a
    simple client-server application that consists of
    a currency converter enterprise bean and two
    clients a J2EE client and a web client that
    consists of a JSP page.

3
The Setup
  • Source code from http//java.sun.com/j2ee/download
    .htmltutorial
  • Get the J2EE1.3 from http//java.sun.com/j2ee
  • Get the ant build tool from Jakarta. This is
    similar to make utility of unix.
  • Setup the environment variables
  • JAVA_HOME location of J2SE installation
  • J2EE_HOME location of J2EE installation
  • ANT_HOME location of ant installation
  • PATH include bin directories of J2EE, J2SE
    and ant installation

4
Starting the Server
  • J2EE server is a web server, servlet server and
    also an application server.
  • You start it by
  • j2ee verbose
  • You stop the server by
  • J2ee -stop

5
Deployment
  • Has two modes command line and GUI interface.
  • In the case of GUI tool you create an ear file
    and the drop the component modules into this
    ear (enterprise archive) file.
  • In the case of command line you will make the
    components first and then assemble them into an
    ear file.
  • To start a deploy tool
  • deploytool

6
Application source code
  • An enterprise bean which represents the business
    logic of an application
  • Remote interface defines the business methods
    that a client may call.
  • Home interface defines the methods to create,
    find or remove an enterprise bean.
  • Enterprise bean class implements the two
    interfaces and also callbacks for containers.
  • Our application is called converter. Lets study
    the code representing these files.

7
Compiling the Source code
  • The compile targets for this tutorial are
    available in a file build.xml.
  • You compile the converter java files by
  • ant converter

8
Packaging
  • For this example, ear file will be
    ConverterApp.ear
  • This file will contain EJB JAR file, Web
    clients WAR file and Application clients JAR
    file/class file
  • Deploytool helps in configuring and packaging
    each component. It automatically creates the
    deployment descriptor.

9
Packaging the enterprise bean
  • Add the classes that make the bean component
    Converter.class, ConverterBean.class,
    ConverterHome.class to the jar
  • Specify properties bean type (session, entity,
    etc.), transactions etc. The deploytool has
    various tabs and support to specify these.

10
Application Client
  • Written in Java. Can run on any Java runtime
    (need not be J2EE).
  • In this application client requires two JAR
    files JAR file for the J2EE containing clients
    deployment descriptor and its class files, and
    the second JAR files containing stub classes
    required at run time by the client.

11
Application Client (contd.) and Web Client
  • Basic tasks performed by the client of an
    enterprise bean
  • Locating the home interface
  • Creating an enterprise bean instance
  • Invoking a business method
  • Deploytool
  • Creates clients deployment descriptor
  • Puts deployment descriptor and client code into a
    JAR file
  • Add the JAR file to the applications
    ConverterApp.ear file
  • We use JSP for this purpose contains the same
    tasks as the application client plus web display
    elements.

12
Deployment and Running the Clients
  • JNDI We also specify JNDI names using the
    deploytool.
  • Tools ? deploy of the tool.
  • http//java.sun.com/j2ee/tutorial/1_3-fcs/doc/Tool
    s10.html
  • runclient etc. to run from command line
  • Webclient
  • http//lthostgt8000/converter
Write a Comment
User Comments (0)
About PowerShow.com