トップ 一覧 ping 検索 ヘルプ RSS ログイン

3.3 Webコンテナのリクエスト処理モデルの変更点

  • 追加された行はこのように表示されます。
  • 削除された行はこのように表示されます。
!!!フィルタを設定し、リクエストまたはレスポンスのラッパーを作成する。設計の不具合があれば、フィルタまたはラッパーを適用する

::フィルタモデル
{{ref_image filter_model.jpg}}

::web.xml
 <filter>
   <filter-name>Section3_3_1Filter</filter-name>
   <filter-class>filter.Section3_3_1Filter</filter-class>
 </filter>
 <filter-mapping>
   <filter-name>Section3_3_1Filter</filter-name>
   <url-pattern>/wiki/*</url-pattern>
   <dispatcher>REQUEST</dispatcher>
   <dispatcher>FORWARD</dispatcher>
   <dispatcher>INCLUDE</dispatcher>
   <dispatcher>ERROR</dispatcher>
 </filter-mapping>

'''dispatcher'''
何も指定しないと、REQUESTから呼ばれた場合にのみフィルターが適用される。
指定することによって、呼び出し方法毎にフィルターを適用するか否かを設定できる。

{{ref_image filter.jpg}}

*doFilter メソッドの引数は、HttpServletRequest、HttpServletResponse '''ではない'''
----
{{amazon 1932394389}}
[SCWCD Exam Study Kit: Java Web Component Developer Certification (ペーパーバック)|http://www.amazon.co.jp/dp/1932394389?tag=typea09-22&link_code=as3&creativeASIN=1932394389&creative=3999&camp=767]