Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Creating a Nexaweb Application requires that the developer create:

...

Nexaweb アプリケーションを作成する場合は、次のファイルを作成する必要があります。

  • ユーザー インターフェイス (UI)

...

  • のレイアウトを定義する XML ファイル
  • MCO (Managed Client Objects)、JSP (

...

  • JavaServer Pages

...

To do this, you need, at a minimum, an editor and Java compiler. Most developers these days use some form of Integrated Development Environment (IDE), which provides additional tools to make the developer more productive. For example, Nexaweb also provides an IDE called Nexaweb Studio that provides tools to graphically create Nexaweb UI XML files. Many software projects use an automated command-line build tool to facilitate routine builds, and Apache Ant has become a de facto standard for these types of systems. Ant is also used by developers who prefer to use "plain" text editors such as Emacs, VI, or Notepad. This document will discuss the steps required to build a typical Nexaweb application with both Ant and Nexaweb Studio.

...

  • )、およびサーブレット用の Java ファイル

 Note: Nexaweb-enabled applications may be deployed on any Servlet container that conforms to the Servlet 2.3 (or later) specification, including Apache Tomcat and J2EE application servers.

...

これらのファイルを作成するには、少なくともエディタと Java コンパイラが必要です。今日、ほとんどの開発者は何らかの IDE (Integrated Development Environment: 統合開発環境) を使用しています。このような開発環境では、ツールを追加して使用できるため、作業の生産性が向上します。たとえば、Nexaweb も Nexaweb Studio と呼ばれる IDE を提供しています。このツールを使用すると、Nexaweb UI XML ファイルをグラフィカルに作成することができます。多くのソフトウェアプロジェクトでは、日常的に行われるビルドを円滑に実施するために、自動化されたコ マンドラインビルドツールが使用されます。このようなシステムでは、Apache Antが 事実上の業界標準になっています。また、Ant は Emacs、VI、ノートパッドなどの「プレーン」テキストエディタを使用することを好む開発者によっても使用されます。ここでは、典型的な Nexaweb アプリケーションを Ant と Nexaweb Studio の両方を使用してビルドする場合に必要な手順について説明します。

このドキュメントは、読者が Ant の使用方法を既に理解していることを前提として書かれています。Ant の使用方法がわからない場合は、Ant の Web サイト、

Apache Ant - http://ant.apache.org/

...

に記載されている情報を参照してください。また、このサイトの「Documentation」ページには、新規ユーザーと上級ユーザーの両方を対象とした優れたチュートリアルがあります。

注: Nexaweb に対応したアプリケーションは、Apache Tomcat や J2EE アプリケーションサーバーなど、Servlet 2.3 以降の仕様に準拠するサーブレットコンテナにデプロイすることができます。

Nexaweb に対応したアプリケーションは、追加の Nexaweb リソースを使用して、標準の J2EE Web アプリケーションとしてデプロイできます。典型的な Web アプリケーションは次に示すような構成になっています。


…/mywebapp/
   - index.html (and other web pagesおよびその他の Web ページ)
   - WEB-INF/
      - web.xml (defines web application resources and configurationWeb アプリケーションのリソースと設定を定義)
      - classes/ (contains Java classesクラスを含む)
      - lib/ (contains Java Jar librariesライブラリを含む)
 

...

公開されている Web リソース (例: HTML ファイル) は、WEB-INF ディレクトリを除く、最上位のディレクトリとその他のディレクトリに格納されています。WEB-INF は、外部ユーザーにコンテンツが表示されない特殊なディレクトリです。このディレクトリには、サーブレット用の Java クラス (WEB-INF/classes 内に保存)

...

Java

...

ライブラリ ファイル (

...

WEB-INF/lib 内に保存)

...

など、Web アプリケーションの非公開リソースと構成情報が含まれています。WEB-INF/web.xml

...

Adding Nexaweb Platform Resources

...

は、ロードするサーブレット、URL マッピング、およびその他のリソースについての情報を含む Web アプリケーション用のコンフィギュレーション ファイルです。

Nexaweb に対応したアプリケーションは、一部の追加リソースとまったく同じ構造を持ちます。


Nexaweb Platform リソースの追加
Nexaweb Platform を新規または既存の Web アプリケーションに追加するには、いずれの場合も同じ基本手順に従いますが、既存のアプリケーションの場合は、Nexaweb Platform をアプリケーションに追加する前に、次の既存のファイルを処理する必要があります。
  • index.jsp - Nexaweb

...

  • はこのファイルを使用して、ユーザーの Web ブラウザ内で Nexaweb クライアントのコードを起動します。index.jsp が開発プロジェクトに既に存在する場合は、nexaweb-platform.zip の index.jsp を別のファイルにコピーして、Nexaweb を起動する準備ができたら、Web ブラウザからそのファイルを呼び出す必要があります。
  • WEB-INF/web.

...

  • xml -

...

  • nexaweb-platform.zip

...

  • ファイルは、既存のプロジェクトの WEB-INF/web.xml

...

To add Nexaweb Platform to a new or existing web application, follow these steps:

...

  • ファイルに追加のアイテムを統合します。このような追加のエントリによって、Nexaweb サーブレットが定義および設定されます。これらのサーブレットは、Nexaweb が正しく機能するために、Web アプリケーション内に存在する必要があります。
Nexaweb Platform を新規または既存の Web アプリケーションに追加するには、次の手順に従います。
  1. 新しいプロジェクト ディレクトリ (例: mywebapp) を作成します。
  2. <nexaweb install>/dist/nexaweb-platform.zip

...

  1. をこのディレクトリに解凍します。
これにより、Nexaweb の基本サポート機能がプロジェクトに追加されます。

…/mywebapp/
   - index.jsp (lauches the Nexaweb clientクライアントを起動)
   - Nexaweb/ (public Nexaweb resources for JVM detection, etc.JVM の検出などに使用される Nexaweb の公開リソース)
   - WEB-INF/
      - web.xml (Nexaweb web application resources are included by the Nexawebify processNexawebify プロセスにより、Nexaweb Web アプリケーションのリソースが含まれる)
      - nexaweb-xxx.xml (Nexaweb configuration informationの構成情報)
      - lib/ (Nexaweb libraries are insertedライブラリが挿入される)
      - Nexaweb/ (contains Nexaweb private resourcesの非公開リソースを含む)
 

...

これで、既存の XML および Java/J2EE

...

An even simpler way to get started is to leverage the existing samples provided with Nexaweb, their Apache ANT build files and the ‘nexawebify’ task.

...

All of the samples provided with Nexaweb include an Apache ANT build file and Nexaweb Studio project files. Using one of these samples as a starting point for your Nexaweb-enabled application will save you a great deal of time as you will start with a best practices project already configured.

...

ツールを使用して、UI 用の NXML ファイル、JSP、およびサーブレットを作成する準備ができました。
また、Nexaweb に付属する既存のサンプル、このサンプルに含まれている Apache ANT ビルドファイル、および「Nexawebify」タスクを活用すれば、もっと簡単に作成に取り掛かることができます。

ANT を使用した、Nexaweb に対応したアプリケーションのビルド

Nexaweb に付属するサンプルにはすべて、Apache ANT ビルドファイルと Nexaweb Studio のプロジェクトファイルが含まれています。Nexaweb に対応したアプリケーションを作成するにあたってこれらのサンプルのいずれかを利用すると、設定済みの最も優れたプロジェクトを初めから活用できるため、 開発にかかる時間が大幅に短縮されます。
build.xmlの 宣言や命令の多くは、Web アプリケーションのビルドで一般的に使用されるスクリプトです。ただし、Nexawebify という命令は Nexaweb Platform に固有のものです。この命令により、nexaweb-platform-installer.jar (

...

Nexaweb Platform

...

インストールディレクトリの bin フォルダ内のファイル) でプログラムが実行されます。Nexaweb Platform インストールディレクトリの dist フォルダにある nexaweb-platform.zip

...

からコンポーネントを順に収集して、Nexaweb Platform のクラスライブラリ、JSP ページ、および Nexaweb Platform コンポーネント用のデフォルトイメージを実行時にアプリケーションで使用できるようにします。このプロセスの一環である Nexawebify 命令により、Nexaweb Platform コンポーネントへの参照を含めるために WEB_INF/web.xml

...

To use existing build files, follow these steps:

  1. Copy the build.xml and build.properties files from the root directory of an existing project into the root directory of the current project.
  2. Edit the build.xml file to specify the current project name at the top of the file.
  3. Edit the build.properties file to specify the Nexaweb home directory on this system.

You can use ANT to build the project from Nexaweb Studio or at the command line.

Using Nexaweb Studio

To use Nexaweb Studio to build the project, follow these steps:

  1. In the Java Perspective, select Show View > Other > ANT.
    The ANT view opens at the bottom of the workbench.
  2. Drag the build.xml file for this project into the ANT view.
    The ANT view displays a list of the projects you can build.
  3. Double click on dist, to build the project.
    A WAR file appears in this project's  /dist directory.

Using the Command Line

...

が変更されます。最後に、index.jsp ファイルが作成されます。このファイルは、ブラウザのリクエストによって呼び出されたときに、アプリケーションを起動するために使用されます。
既存のビルドファイルを使用する場合は、次の手順に従います。
  1. build.xml ファイルと build.properties ファイルを、既存のプロジェクトのルート ディレクトリから現在のプロジェクトのルート ディレクトリにコピーします。
  2. build.xml ファイルを編集して、ファイルの一番最初で現在のプロジェクト名を指定します。
  3. build.properties ファイルを編集して、このシステムの Nexaweb ホーム ディレクトリを指定します。
ANT を使用して、Nexaweb Studio またはコマンドラインからプロジェクトをビルドすることができます。
Nexaweb Studio を使用する場合
Nexaweb Studio を使用してプロジェクトをビルドするには、次の手順に従います。
  1. Java パースペクティブで、[Show View、[Other、[ANTの順に選択します。] ]]
    ANT ビューがワークベンチの下側に開きます。
  2. このプロジェクトの build.xml ファイルを ANT ビューにドラッグします。
    ビルド可能なプロジェクトのリストが ANT ビューに表示されます。
  3. dist をダブル クリックしてプロジェクトをビルドします。
    WAR ファイルがこのプロジェクトの /dist ディレクトリに表示されます。
コマンドラインを使用する場合
  1. コマンド プロンプトで、ビルドするプロジェクトのルート ディレクトリに移動します。
  2. MS-Windows 環境の場合は、「%ANT_HOME%\bin\ant.ext build.

...

Procedure for deploying the application to your Servlet container

...

  1. xml」と入力して Enter キーを押します。
    WAR ファイルがこのプロジェクトの /dist ディレクトリに表示されます。

サーブレットコンテナにアプリケーションをデプロイする手順
各サーブレット コンテナには、エンド ユーザーが新規アプリケーションを使用できるようにする独自の手順があります。幸いなことに、それらはすべて WAR ファイル構造を認識します。このファイル構造には、サーブレット コンテナがデプロイに必要とするすべての要素が含まれています。使用するサーブレット コンテナの手順に従うことによって、アプリケーションを実行およびテストできるようになります。