Java EE Introduction

Материал из Wiki.crossplatform.ru

(Различия между версиями)
Перейти к: навигация, поиск
(Новая: <h1>Introduction</h1> In this part of the JEE tutorials, we will talk about the goals of the tutorials and we provide some definitions. == About JEE tutorials == The JEE tutorials ar...)
Строка 80: Строка 80:
* Resin application server
* Resin application server
* MySQL database
* MySQL database
 +
 +
[[Категория:Java]]

Версия 09:29, 25 февраля 2009

Содержание

Introduction

In this part of the JEE tutorials, we will talk about the goals of the tutorials and we provide some definitions.


About JEE tutorials

The JEE tutorials are a set of tutorials covering the Java Platform, Enterprise Edition. (JEE) The purpose of the tutorials is to introduce novice programmers to the JEE platform.


JEE programmer

Every good JEE programmer must acquire an enourmous amount of knowledge. Everybody tells you what to study, but no one tells you how to study. One can easily be lost in all this tools, technologies, recommendations, libraries. There are many tools that help advance programmers develop their applications. But on the other hand, they bring additional complexity to development. Tools like XDoclet or Hibernate help advanced JEE programmers focus on the application logic, but necessarily make the learning curve steeper for a novice programmer. Have a look at the various Apache projects at www.apache.org. Ant, Cocoon, iBATIS, Struts, Maven, Tapestry, Xalan, Velocity. Just to name a few.

You cannot become a general, unless you were a private. You must go to the top, from the very bottom. There is no shortcut available. The best way for a novice programmer is a step by step approach. Pick one tool, library at a time and play with it. Realizing all this, I have made the tutorials to cope with all this complexity. We will begin with the very basic things like installing necessary tools, trying very simple JSP files or servlets.

Java Platforms

The world of Java is divided into the following three platforms.

  • Java Platform, Standard Edition, Java SE
  • Java Platform, Micro Edition, Java ME
  • Java Platform, Enterprise Edition, Java EE


The Java SE is the core Java technology platform. It is used to create Java desktop and server applications. The Java ME is aimed at creating applications for portable devices like cell phones or PDAs. The Java EE is a platform for creating large enterprise applications. It adds libriaries necessary to create stable, secure, multi-tier, distributed applications.


Java EE

Java Platform, Enterprise Edition is a set of libraries, tools, specifications, best practices for developing, deploying and managing server side enterprise level applications.

Each application is executed on the application server. Some of the well known application servers are JBoss, OCJ, Resin, WebLogic. In this tutorials, we will use Resin. To create and manage source code, developers use Integrated Development Environments, (IDEs). The most popular IDEs are NetBeans, Eclipse, JDeveloper and IntelliJ IDEA.

The key technologies of the Java EE are:

  • Web Services Technologies
  • Web Application Technologies
  • Enterprise Application Technologies
  • Management and Security Technologies

To install all this techologies, we can go to sun download site, or we can download the NetBeans JEE pack. These techologies are included in this pack.

The Java Platform, Enterprise Edition is not limited to these technologies. The platform has a wide variety of additional tools and libraries. The numerous Apache projects are good examples.

The Java EE also consists of a set of best practicies, coding styles and software patterns.


Web Application

An enterprise application consists of web modules. These are packaged in war files. A war (short for Web Archive) file is jar file used to distribute a collection of JavaServer Pages, servlets, Java classes, XML files, tag libraries and static Web pages. They create a web application. Smaller web applications can be packaged in a war file.

All servlets, classes, static files, and other resources belonging to a Web Application are organized under a directory hierarchy.

center

The root directory of this directory structure is called the document root. Let's have a web application called email. For the Resin AS, the path to the document root would be:

RESIN_INSTALL_DIR/webapps/email

We place our files and resources under the document root directory. All files are visible except for a special directory WEB-INF. All files under the WEB-INF directory are privite and are not visible to the client. The WEB-INF directory is optional, but it is always created unless we create some very simple examples.

The WEB-INF directory contains two special files and two directories. The web.xml file is a web application deployment descriptor. It is used to configure the web application. The web.xml file is a Java EE deployment descriptor. It is defined by a specification. There is another type of descriptor called runtime deployment descriptor. It is used to configure Java EE implementation specific parameters. In the case of Resin Application Server, the runtime deployment descriptor is called resin-web.xml. In case of Glassfish AS it is called sun-web.xml.

The two special directories are named classes and lib. We place all compiled servlets and utility classes under the classes directory. The lib directory contains additional libraries in form of jar files. These can be e.g. third party libraries like database drivers or xml parsers.

It is conventional to put tag files into the tag directory.

Tools

The tools, that we use in the JEE tutorials are:

  • JDK 1.6
  • NetBeans 6
  • Resin application server
  • MySQL database