| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

「3.3 Webコンテナのリクエスト処理モデル」の版間の差分

提供: MyMemoWiki
ナビゲーションに移動 検索に移動
 
(同じ利用者による、間の1版が非表示)
12行目: 12行目:
 
   <filter-name>Section3_3_1Filter</filter-name>
 
   <filter-name>Section3_3_1Filter</filter-name>
 
   <url-pattern>/wiki/*</url-pattern>
 
   <url-pattern>/wiki/*</url-pattern>
   <dispatcher>REQUEST</dispatcher>
+
   <dispatcher>[[R]]EQUEST</dispatcher>
   <dispatcher>FORWARD</dispatcher>
+
   <dispatcher>FO[[R]]WA[[R]]D</dispatcher>
 
   <dispatcher>INCLUDE</dispatcher>
 
   <dispatcher>INCLUDE</dispatcher>
   <dispatcher>ERROR</dispatcher>
+
   <dispatcher>E[[R]][[R]]O[[R]]</dispatcher>
 
  </filter-mapping>
 
  </filter-mapping>
  
 
'''dispatcher'''
 
'''dispatcher'''
何も指定しないと、REQUESTから呼ばれた場合にのみフィルターが適用される。
+
何も指定しないと、[[R]]EQUESTから呼ばれた場合にのみフィルターが適用される。
 
指定することによって、呼び出し方法毎にフィルターを適用するか否かを設定できる。
 
指定することによって、呼び出し方法毎にフィルターを適用するか否かを設定できる。
  
 
[[File:0091_filter.jpg]]
 
[[File:0091_filter.jpg]]
  
*doFilter メソッドの引数は、HttpServletRequest、HttpServletResponse '''ではない'''
+
*doFilter メソッドの引数は、HttpServlet[[R]]equest、HttpServlet[[R]]esponse '''ではない'''
 
----
 
----
 
{{amazon|1932394389}}
 
{{amazon|1932394389}}
| [[http://www.amazon.co.jp/dp/1932394389?tag=typea09-22&link_code=as3&creativeASIN=1932394389&creative=3999&camp=767 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 SCWCD Exam Study Kit: Java Web Component Developer Certification (ペーパーバック)]

2020年2月16日 (日) 04:21時点における最新版

フィルタを設定し、リクエストまたはレスポンスのラッパーを作成する。設計の不具合があれば、フィルタまたはラッパーを適用する

フィルタモデル

0092 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から呼ばれた場合にのみフィルターが適用される。 指定することによって、呼び出し方法毎にフィルターを適用するか否かを設定できる。

0091 filter.jpg

  • doFilter メソッドの引数は、HttpServletRequest、HttpServletResponse ではない

SCWCD Exam Study Kit: Java Web Component Developer Certification (ペーパーバック)