Struts 1.3 [Java]
○はじめに
- Struts 1.3 もリリースされたようですので、主な変更点を整理してみます。
○Struts Action Library
- Struts 1.2.8 から、Struts を複数のサブプロジェクトに分割し、おのおの個々のリリースサイクルを持たせるように変更されました。具体的には、Struts の subproject には、以下の7つが存在します。
- Action
- Applications
- EL
- Extras
- Site
- Taglibs
- Tiles.
これらのサブプロジェクトは、Struts 1.3 にも継承され、同じライブラリを使用しますが、
今後 subproject の revision は(Struts1.2系列、1.3系列)個々に変更されることとなるようです。
○依存関係に関する変更
- 仕様に関する変更
Servlet 2.3, JSP 1.2, J2SE 1.4 に依存 - ソフトウェアコンポーネントに関する変更
Commons Chain 1.0, FileUpload 1.1, Commons IO 1.1, Commons Validator 1.2 に依存
○Struts 1.2, 1.3 の採用基準に関して
- Struts 1.3 はたくさんのページ群から構成され、画面遷移が複雑な Web アプリケーションを想定したフレームワークです。シンプルな Web アプリケーションであれば、Model1 つまり 1.2.x を利用するほうが望ましいとのことです。
○Struts Action Framework
- 主な変更点は以下のとおりです。以下で個々の変更点を整理してみます。
- Composable Request Processor
- Arbitrary configuration properties
- Catalog and Command Elements
- Opt-In Cancel Handling
- Enhanced Global Exception Handlers
- Extends attribute
- "isCommitted" Exception Handling
- Postback Actions
- Wildcard ActionConfig properties
○Composable Request Processor
- 以前のバージョンでは、Request Processing は、以下のように一連のメソッドとして表現されていました。よって、メソッドを override し、異なる機能を提供することは容易でありました。しかし、それぞれが異なる方法で Request Processor を override し、複数の拡張を利用することは容易くありませんでした。
そこで、Action 1.3 では、Request Processor のメソッドを Command に変更します。これにより、モノシリックなオブジェクトをサブクラス化するのではなく、Command を取り替えることができるようになります。public void process(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { processLocale(request, response); if (!processRoles(request, response, mapping)) { return; } /// ... ActionForward forward = processActionPerform(request, response, action, form, mapping); processForwardConfig(request, response, forward); }
Command は、挿入したり、除いたりすることができ、もし、必要ならば、異なる種類のアプリケーションのニーズに適合させるために、Request Processing を拡張させたり、不要なCommandを除き、合理化することが可能となります。
以前のバージョンと互換性を確保していることは、もちろん期待されています。よって、追加の変更を加える前に、Composable Request Processor を持つ 1.3 をリリースすることとなったようです。Action 1.3.x で変更や向上がされる予定です。もし必要ならば、Struts 1.2 からのモノシリックな Request Processor を利用することも可能です。
ただし、モノシリックな Request Processor は、Legacy Class と位置づけられており、Opt-In Cancel Handling のような新機能は Composable Request Processor のみによって、サポートされるようです。
○Arbitrary configuration properties
- ほとんど全ての Struts の設定の要素は、key/value のペアの対応づけを可能とします。これにより、設定を外部化することが可能となり、再利用化を促進することが可能です。
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { string foo = getProperty("foo"); // ...
○Opt-In Cancel Handling
- Struts 1.2 およびそれ以前では、キャンセルタグにより生成されたトークンがリクエストの中に存在する場合はどんなときでも、ActionForm に対するvalidationはスキップされていました。よって、Struts 1.2 およびそれ以前では、validation に依存する Action は常に isCancelled メソッドをチェックする必要がありました。
Struts Action 1.3 では、新しいプロパティの"canccellable"がAction Mapping でセットされているときのみ、キャンセルトークンは有効となります。もし、キャンセルトークンが存在し、cancellable がセットされていなければ、 InvalidCancelException が throw されます。InvalidCancelException は、他の例外のように Declarative Exception Handler によって catch されます。
Declarative Exception Handler は、オプションの位置づけとなります。 - ※注意点:
Opt-In Cancel Handler は、1.3 で導入された Composable Request Processor を使用する場合のみ有効となります。標準の CANCEL BUTTON を使用し、mapping の定義として validate を true にセットした場合には、mapping の定義として "cancellable=true" と指定しなければなりません。
さもなければ、キャンセルボタンが使用されたときには、InvalidCancelException が throw されます。
○Enhanced Global Exception Handlers
- ActionConfig が認識できない場合の Global Exception Handlers の利用をサポートします。ActionConfig が存在しない場合、AbstractExceptionHandler は、ModuleConfig 内の新しいメソッドを呼び出します。このメソッドは、与えられた例外クラスもしくはスーパークラスに対応付けられた例外ハンドラを探す同様のロジックを提供します。
○Catalog and Command elements
- Controller と どんな Action Mapping の両方で利用可能です。
- catalog:commons-chain catalogの名前
- command:commons-chain command の名前
※要調査。理解できていないため、原文を掲載
catalog - The name of a commons-chain catalog in which to look up a command to be executed as part of servicing this request. Only meaningful if "command" is also specified.
command - The name of a commons-chain command which should be looked up and executed as part of servicing this request.
○Extends attribute
- Struts の 設定ファイルでは、他の要素からのディフォルト設定を適用するために、拡張した属性を使用することが可能となります。OOプログラミングの継承の概念を設定ファイルに持ち込んだと考えるとわかりやすいかもしれません。
...
○"isCommitted" Exception Handling
- Tiles を使用する場合、Exception が発生したとき、レスポンスは既にコミットされている場合があります。今回の変更により、ExceptionHandler は、response.isCommitted をチェックし、もし、true ならば、フォワードするのではなく、設定された view path を含みます。更新された ExceptionHandler は、新しい設定の属性を許容します。これにより、他の振る舞い、もしくは振る舞いがないことをを選択することが可能となります。
○Postback Forms
- Form taglib のAction属性はオプション扱いとなりました。もし、省略した場合、リクエストの元のURIが使用されます。
○Wildcard ActionConfig properties
- Wildcard は ActionConfig のプロパティの中で使用されます。これにより、"parameter"属性を複雑にさせずに、複数のリクエスト時の値を Actionに渡すことが可能となります。
○Other Miscellaneous Changes
- 設定を介し DynaActionForm プロパティの値をリセットすることをサポート
- Servlet2.3で導入された HttpServletRequestWrapper を拡張するMultipartRequestWrapper を変更
- マルチパートリクエストでのフィールドごとの文字エンコーディングをサポート
○Struts EL
○Struts Extras
○Struts Site
○Struts Taglibs
○Struts Tiles
- →リリースノート参照
○References
- Struts 1.3 Release Notes
http://struts.apache.org/struts-action/userGuide/release-notes.html - Wiki Upgrade pages
http://wiki.apache.org/struts/StrutsUpgrade
トラックバック 38
Discount phentermine. Phentermine. Lowest online phentermine price. Order phentermine online.
Stacker 2 with ephedra. Ephedra lafayette la. Ephedra.
Meridia. Meridia back pain. Tell me about the weight loss pill meridia. Meridia side effects. Meridia research.
Xanax 2 mg 180 pills. Buy 180 xanax. Buy xanax without prescription. Xanax. Xanax with klonopin. Xanax cocktail.
Buy percocet. Percocet dependency.
How to cut down on xanax. Xanax overdose. Xanax drug test. Generic xanax no prescription. Xanax. Geniric xanax.
Elavil 10mg. Elavil facts. Taking elavil with celexa. When will elavil work for preventing migraine. Elavil. Elavil dosage for insomnia. Off lab…[続く]
Adderall erowid. Adderall.
Levaquin.
Tetracycline. Dental treatment for tetracycline poisoning. What do tetracycline pills look like.
Hydrocodone. Hydrocodone without prescription. Opana same effects hydrocodone. Hydrocodone withdrawal.
Synthesis of aspirin. Aspirin dissolve in water or diet sprite. Daily dose aspirin and heart disease. Aspirin packaging cost. Aspirin side effec…[続く]
Uv absorbance of tetracycline. Dental treatment for tetracycline poisoning. Tetracycline. Tetracycline discoloration teeth. Tetracycline bacteri…[続く]
Ephedrine. Ephedrine to buy. Ephedrine products. Ephedrine weightloss drops. Ephedrine faq. Interactions between ephedrine and lexapro.
Paxil heart racing. Paxil. Buy paxil online.
Ephedra swarm. Ephedra.
Levaquin side effects. How long does levaquin remain in body. Levaquin. Levaquin kidneys. Levaquin side effects versus avelox side effects.
How long has zyrtec been on the market. Zyrtec 10mg. Zyrtec.
Topamax ney. Exercise bulimia topamax. Lose weight with topamax. Topamax and weight. Psychopharmacology topamax treatment migraines.
Zyrtec contraindications. Zyrtec d 12 hour. Zyrtec.
Propecia uk medix plus forum. Propecia pill. Propecia uk order online.
Hartford oxycontin attorneys. Oxycontin online. Oxycontin. Georgia oxycontin attorneys.
Buy vicodin without script.
Tetracycline babies civil suits. Tetracycline how to take.
Glucophage 500mg. Glucophage spc from the emc. Glucophage xr. Glucophage side effects. Glucophage.
Zithromax dosage.
Ambien withdrawal dangers. Ambien. Where can i buy ambien for next day delivery. Ambien overnight. Buy ambien without prescription.
Side effects of doxycycline. Reduce allergic reaction to doxycycline. Doxycycline.
Tramadol 180. Cheap tramadol. Side effects of tramadol. Tramadol. Tramadol c.o.d delivery. Tramadol maintence.
Discount phentermine. Cheap phentermine. Phentermine. Phentermine without prescription. Phentermine diet pills. Abuse phentermine. Phentermine m…[続く]
Side effects of paxil cr. Can you take paxil and valerian together. Paxil dose increase. Paxil heart racing. Paxil. Buy paxil without prescripti…[続く]
Xanax bars. Xanax.
Buy cialis online. Cialis 20mg. Cialis best price buy online. Cialis.
Cialis canada. Cialis best price buy online. Buy viagra online uk cialis levitra. Cheap cialis. Cialis and drug craving.
Drug called cialis. Cialis best price buy online. Cialis users. Taking viagra with cialis. Blood pressure cialis tadalafil. Taking cialis. Ciali…[続く]
Carisoprodol. Carisoprodol phentermine yellow. Carisoprodol 350mg.
Allegra cole nude. Allegra. Allegra r andreoli. Not take allegra d. Allegra d side effects. Allegra versace.
Far from idleness being the root of all evil, it is rather the only true good.







コメント 0