|
The VelocityStruts sub-project integrates Velocity with the
Jakarta Struts
Web application framework and enables the use of velocity templates
interchangeably with JSP pages for the view layer.
VelocityStruts サブプロジェクトは Velocity と
Jakarta Struts
Web アプリケーションフレームワークとを統合し、
ビューレイヤとして JSP の代わりに Velocity
テンプレートを使用することを可能にします。
Various other
web application frameworks
offer built-in support for Velocity templates. This project
provides the minimal glue necessary to give Struts developers
an alternative to JSP.
多様多種の
Web アプリケーションフレームワーク
が Velocity テンプレートをサポートしています。
このプロジェクトでは、 Struts 開発者に JSP の代わりとなる必要最小限のセットを提供します。

Diagram 1. Comparison of JSP and Velocity for
the view layer in a Struts application.
図 1. Struts アプリケーションのビューレイヤにおける、
JSP と Velocity の比較。
As we follow the typical Struts process flow in Diagram 1,
notice how there is relatively little change except for the addition
of Velocity. The velocity-struts.jar leverages a standalone Velocity
servlet to process template files (specifically, the jar file is
velocity-tools-x.x.jar) and uses some drop-in tools to provide
transparent access to Struts specific objects (ex. message resources,
form beans, errors, links). The action mapping file will simply contain
ActionForwards that send control to a Velocity-based View layer instead
of sending to a JSP.
図1の典型的な Struts の処理フローでは、 Velocity
が追加されることを除けば比較的小さな変更だということに気づくでしょう。
velocity-struts.jar はテンプレートファイルを処理するスタンドアロンの
Velocity サーブレット(具体的には、 velocity-tools-x.x.jar という JARファイルです)、
Struts 固有のオブジェクト(例: メッセージリソース、フォームビーン、エラー、リンク)
への透過的なアクセスを提供するいくつかのツールを使用します。
アクションマッピングファイルは制御を JSP の代わりに Velocity
ベースのビューレイヤへ渡す ActionForward を含んでいます。
Also notable is that Velocity and JSP are not
mutually exclusive. Both technologies can be used in the same
application without any problems. This allows developers the option
of trying Velocity without heavy modification to existing applications.
さらに、注目すべきは Velocity と JSP は排他的ではないということです。
何の問題も無しに、両方のテクノロジを同一アプリケーション内で使用することができます。
既存のアプリケーションに大きな変更を入れることなく、
開発者が Velocity を試すことが可能です。
We're convinced that once you give Velocity a try, you'll really like it.
一度 Velocity を試してみれば、きっと病みつきになると思いますよ!
|