J2EE Study by malj

VIEWS: 22 PAGES: 11

									CS 8V02 J2EE Study                                                                   University of Texas at Dallas
____________________________________________________________________________________________________________




                                                             Contents


J2EE STUDY..................................................................................................................... 1
   PART 1. J2EE STUDY ....................................................................................................... 1
      1.1 J2EE Overview...................................................................................................... 1
      1.2 J2EE Component .................................................................................................. 2
      1.3 Download and Install J2EE .................................................................................. 2
   PART 2. A WEB SEARCH ENGINE RUNNING ON J2EE ...................................................... 5
   2.1 ARCHITECTURE .......................................................................................................... 5
      2.2 The 4-tier implementation using J2EE Platform .................................................. 6
      2.3 Running the Web Search Engine on J2EE ............................................................ 6
      2.4 Problems and Future Work ................................................................................... 9




_______________________________________________________________________________________________________                        0
Fan Xu                                            3/19/2010
CS 8V02 J2EE Study                                                                   University of Texas at Dallas
____________________________________________________________________________________________________________



                                             J2EE Study

The report includes two parts: part 1: J2EE study, and part2: A Web search engine running on J2EE.



Part 1. J2EE Study


1.1 J2EE Overview
The Java 2 Platform, Enterprise Edition (J2EE ) technology provides a component-based approach to
the design, development, assembly, and deployment of enterprise applications. The J2EE platform offers a
multitiered distributed application model, the ability to reuse components, integrated Extensible Markup
Language (XML)-based data interchange, a unified security model, and flexible transaction control. Not
only can you deliver innovative customer solutions to market faster than ever, but also your platform-
independent J2EE component-based solutions are not tied to the products and application programming
interfaces (APIs) of any one vendor. Vendors and customers enjoy the freedom to choose the products and
components that best meet their business and technological requirements.

The J2EE platform uses a multitiered distributed application model. Application logic is divided into
components according to function, and the various application components that make up a J2EE application
are installed on different machines depending on the tier in the multitiered J2EE environment to which the
application component belongs.




                                Figure 1-1 Multitiered Applications

Figure 1-1 shows two multitiered J2EE applications divided into the tiers described in the following list.

                 Client-tier components run on the client machine.
_______________________________________________________________________________________________________         1
Fan Xu                                            3/19/2010
CS 8V02 J2EE Study                                                                   University of Texas at Dallas
____________________________________________________________________________________________________________


                 Web-tier components run on the J2EE server.
                 Business-tier components run on the J2EE server.
                 Enterprise information system (EIS)-tier software runs on the EIS server.

J2EE multitiered applications are generally considered to be three-tiered applications because they are
distributed over three different locations: client machines, the J2EE server machine, and the database or
legacy machines at the back end.


1.2 J2EE Component
J2EE applications are made up of components. A J2EE component is a self-contained functional software
unit that is assembled into a J2EE application with its related classes and files and that communicates with
other components. The J2EE specification defines the following J2EE components:

                 Application clients and applets are components that run on the client.
                 Java Servlet and JavaServer Pages (JSP ) technology components are Web
                  components that run on the server.
                 Enterprise JavaBeans (EJB ) components (enterprise beans) are business
                  components that run on the server.

J2EE components are written in the Java programming language and are compiled in the same way as any
program in the language. The difference between J2EE components and "standard" Java classes is that
J2EE components are assembled into a J2EE application, verified to be well formed and in compliance with
the J2EE specification, and deployed to production, where they are run and managed by the J2EE server.

1.2.1 J2EE Clients
J2EE clients can be a Web client or an application client.

1.2.2 Web Components
J2EE Web components can be either servlets or JSP pages. Servlets are Java programming language classes
that dynamically process requests and construct responses. JSP pages are text-based documents that
execute as servlets but allow a more natural approach to creating static content.

1.2.3 Business Component
Business code, which is logic that solves or meets the needs of a particular business domain such as
banking, retail, or finance, is handled by enterprise beans running in the business tier.

1.2.4 Enterprise Information System Tier
The enterprise information system tier handles enterprise information system software.


1.3 Download and Install J2EE
This tutorial is for how to download and install Java 2 Platform, Enterprise Edition (J2EE ) SDK
1.3.1, Java 2 Platform, Standard Edition (J2SE ) SDK 1.3.1, and ANT for Windows 2000 Professional.

Prerequisite

Your PC should have Microsoft Windows 2000 Professional installed already.

How to Download and Install J2SE SDK
1) Downloading
_______________________________________________________________________________________________________         2
Fan Xu                                            3/19/2010
CS 8V02 J2EE Study                                                                   University of Texas at Dallas
____________________________________________________________________________________________________________


You can download the J2SE SDK 1.3.1 Windows bundle from

http://java.sun.com/j2se/1.3/

The following is the download instruction:

    1.   Click “Download J2SE v1.3.1_02”.
    2.   Select “DOWNLOAD” on the row of “Windows (all languages)”, and the column of “SDK”.
    3.   Click “ACCEPT” for the Binary Code License Agreement.
    4.   Choose one web site to download j2sdk-1_3_1_02-win.exe into your PC.

2) Installing

         1.     Double-click on the icon of j2sdk-1_3_1_02-win.exe file, and follow the instructions
                provided by the setup program. By default, the setup program installs the software in C:\
                jdk1.3.1_02.
         2.     You must set up these environment variables:
                   Set JAVA_HOME -- the directory where you installed this release. If you did
                    not change the default install directory, it would be C:\ jdk1.3.1_02
                    JAVA_HOME= C:\ jdk1.3.1_02
                   Set PATH:
                    PATH=%PATH%;%JAVA_HOME%\bin


How to Download and Install J2EE SDK
1) Downloading
You can download the J2EE SDK 1.3.1 Windows bundle from

http://java.sun.com/j2ee/download.html#sdk

The following is the download instruction:

    1. Enter “Software & Documentation” under “1.3.1 FCS Release January 31, 2002”.
    2. Select “Windows Install” from pull down list “Select a Platform”, then click “continue” button
       on the right side.
    3. Click “ACCEPT” for the “Binary Code License Agreement”.
    4. Choose one web site to download j2sdkee-1_3_1-win.exe into your PC.

2) Installing
If you have installed a previous version of the J2EE SDK product, you must delete or un-install the
previous version from your computer before proceeding with the new version.

    1.   Double-click on the icon of the j2sdkee-1_3_1-win.exe file, and follow the instructions provided
         by the setup program. By default, the setup program installs the software in C:\j2sdkee1.3.1.
    2.   Set the environment variables.
         You must set up these environment variables:
                   J2EE_HOME -- the directory where you installed this release. If you did not
                    change the default install directory, it would be C:\j2sdkee1.3
                         J2EE_HOME= C:\j2sdkee1.3
                   Set PATH:
                    PATH=%PATH%;%J2EE_HOME%\bin
_______________________________________________________________________________________________________         3
Fan Xu                                            3/19/2010
CS 8V02 J2EE Study                                                                   University of Texas at Dallas
____________________________________________________________________________________________________________


                    Set CLASSPATH:
                    CLASSPATH=%CLASSPATH%;%J2EE_HOME%\lib\j2ee.jar


         Set Path For Windows 2000 Professional,
                   Right-click the My Computer icon, select the Properties menu item
                   Select the Advanced tab.
                   Click the Environment Variable button.
                   Click the New button, enter the variable name and its value in the New User
                    Variable dialog, and click the OK button
          For further questions, refer to http://java.sun.com/j2ee/sdk_1.3/install.html.


How to Download and Install Ant

1) Downloading
You can download ant from
http://jakarta.apache.org/builds/jakarta-ant/release/v1.3/bin

You can choose one file to download. jakarta-ant-1.3-bin.zip is recommended for the user who has
WINZIP.

2) Installing

    1.   Unzip the downloaded file into one directory (e.g., C:\ jakarta-ant-1.3).
    2.   Set the ANT_HOME environment variable to the directory where you installed Ant.
          ANT_HOME=C:\ jakarta-ant-1.3
    3.   Set PATH
          PATH=%PATH%; %ANT_HOME%\bin
    4.   Set CLASSPATH


CLASSPATH=%ANT_HOME%\lib\ant.jar;%ANT_HOME%\lib\parser.jar;%ANT_HOME%\lib\jaxp.jar
For further questions, refer to $ANT_HOME$docs\manual\install.html where $ANT_HOME$ is
the directory where you installed Ant.
How to Run the J2EE Server:
Type command:
C:\> j2ee -verbose


How to Stop the J2EE Server:
Type command:
C:\> j2ee -stop
How to Run the Cloudscape Database Server:
Type command:
C:\> cloudscape -start
How to Stop the Cloudscape Database Server:
_______________________________________________________________________________________________________         4
Fan Xu                                            3/19/2010
CS 8V02 J2EE Study                                                                   University of Texas at Dallas
____________________________________________________________________________________________________________


Type command:
C:\> cloudscape -stop
How to Run the Deploytool:
Type command:
C:\> deploytool



Part 2. A Web Search Engine Running on J2EE

A Web search engine is built on J2EE using the KWIC system.

2.1 Architecture
The Web search engine uses the implicit invocation architecture, as shown in Figure 2-1. For the detail,
check at http://www.utdallas.edu/~fanxu/sw.html.




                                                                                                                                     Output
           Input


                                                       Circular                              Alphabe-                 URL
                                                        Shift                                  tizer                  Searcher



                         See
                      Figure 1.3
                                                                                                                       getNorepeat
                      for detail
                                                                                                                       edUrlName
                                                                              A-getCSlines
                                                                  CS-hanURL




                                                                                                        A-to-String
                                   set-URL


                                             I-Lines




                  URL
                 Account
                 Database                                              CONTROL
                                   Announcer                Announcer & Listener Listener




                                                                                     Subprogram call
   Input Media                                                                                                                        Output Media
                                                                                     System I/O
                                                                                     Implicit
                                                                                     Invocation



                               Figure2-1 Implicit Invocation Architecture




_______________________________________________________________________________________________________                                              5
Fan Xu                                            3/19/2010
CS 8V02 J2EE Study                                                                   University of Texas at Dallas
____________________________________________________________________________________________________________


2.2 The 4-tier implementation using J2EE Platform
The implementation was based on the work done by Feng Guo.




                                                 2                              3
                                                                                                4
             1

                                                 Figure. 3.1

(Note: Modified from J2EE Tutorial: A beginner's guide to developing enterprise applications
on the JavaTM 2 Platform, Enterprise Edition SDK version 1.3, Sun Microsystems, Inc., 2002)

Where 4-tier layers are:
   1. Web browser;
   2. JSP pages and JavaBeans;
   3. Entity Beans;
   4. Database.


2.3 Running the Web Search Engine on J2EE
Check at http://www.utdallas.edu/~fanxu/sw.html for the detailed instruction within User Manual part in
the project report.

     1. Starting servers
        The first step includes starting cloudscape server, building database table, starting J2EE server,
        starting deploytool.

    2.   Deployment

    3.   Run the Web Client

         3.1 Point your web browser at the following URL:

                  http://localhost:8000/kwicProject

             In this example the name of the local host is navajo. You will see the Web page like this




_______________________________________________________________________________________________________         6
Fan Xu                                            3/19/2010
CS 8V02 J2EE Study                                                                   University of Texas at Dallas
____________________________________________________________________________________________________________




         3.2 Click Save Web Address on the left menu, enter URL and its description. Then click Submit
             button. You can enter multiple URL and their descriptions at this step.
              (Caution: If the system does not respond after you have entered the URL and its
                description, try some new URL and description that you have never used in this PC.
                This is due to the web browser cache functionality, and has nothing to do with the
                 Microminer system)




         3.3 Click Show Circular Shift Lines on the left menu to display the circular shift results.




_______________________________________________________________________________________________________         7
Fan Xu                                            3/19/2010
CS 8V02 J2EE Study                                                                   University of Texas at Dallas
____________________________________________________________________________________________________________




         3.4 Click Alphabetized Circular Shift Lines on the left menu to display the alphabetized result.




         3.5 Check the tuples in the table. Open one DOS Window, enter cloudscape –isql. Then
            enter select * from webaddressaccount;
            You will see the result like this:




_______________________________________________________________________________________________________         8
Fan Xu                                            3/19/2010
CS 8V02 J2EE Study                                                                   University of Texas at Dallas
____________________________________________________________________________________________________________


                Step 3.3 – 3.5 are optional.

         3.6 Click Key Word Search to start search. Enter the keyword. Click Submit button.




            You will obtain the search result.




           Step 3.6 can be repeated for many times.

    4.   Exit

         After you finish running the system, you should stop everything in this way:

    4.2 Close deploytool.
    4.3 Stop J2EE server by using command j2ee –stop in one DOS Window.
    4.4 Stop cloudscape server by using command cloudscape –stop in one DOS Window.



2.4 Problems and Future Work

_______________________________________________________________________________________________________         9
Fan Xu                                            3/19/2010
CS 8V02 J2EE Study                                                                   University of Texas at Dallas
____________________________________________________________________________________________________________


    1.   Problems in current system

    Classes for Circular Shift, Alphabetizer, and Keyword Search have no connection with database. All of
    them deal with the data in the current session. They do not use the data stored in the database. The
    results of Circular shift and Alphabetizer are saved in the memory. These results will be lost when the
    session finishes.

    2.   Future work

    Class for Circular Shift shall use the data stored in the database. The results of Circular Shift will be
    used by class of Alphabetizer. The results of Alphabetizer will be used by Keyword Search. Depending
    on the size of the problem, the results of Circular Shift and Alphabetizer shall be saved in memory (for
    small size problem) or database (for large size problem). This database shall be destroyed after the
    session finishes.




_______________________________________________________________________________________________________       10
Fan Xu                                            3/19/2010

								
To top