差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
| study:jsf:migration [2008/04/25 14:27] – banana | study:jsf:migration [2008/04/26 12:50] (現在) – banana | ||
|---|---|---|---|
| 行 62: | 行 62: | ||
| </ | </ | ||
| </ | </ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| 行 70: | 行 80: | ||
| ===== Example of Struts-JSF Integration ===== | ===== Example of Struts-JSF Integration ===== | ||
| - | Struts application을 JSF로 이관하는 과정을 이해하기 간단한 logon화면을 보여주는 jsp를 살펴보자.\\ 현재의 struts버전은 대략 다음과 같은 모습이다. | + | Struts application을 JSF로 이관하는 과정을 이해하기 |
| + | 현재의 struts버전은 대략 다음과 같은 모습이다. | ||
| **Listing 1: A simple Struts-based logon JSP** | **Listing 1: A simple Struts-based logon JSP** | ||
| + | |||
| <code html> | <code html> | ||
| <%@ taglib uri="/ | <%@ taglib uri="/ | ||
| <%@ taglib uri="/ | <%@ taglib uri="/ | ||
| + | |||
| < | < | ||
| < | < | ||
| 行 115: | 行 128: | ||
| </ | </ | ||
| - | **Step 1: Change the tag library declarations** 제일 처음에 해야 할 작업은 tag library 선언부를 Struts-JSF tag library로 바꾸는 것이다. 그리고 모든 컴포넌트 태그를 < | + | **Step 1: Change the tag library declarations** 제일 처음에 해야 할 작업은 tag library 선언부를 Struts-JSF tag library로 바꾸는 것이다.\\ |
| + | 그리고 모든 컴포넌트 태그를 < | ||
| <code html> | <code html> | ||
| 行 121: | 行 135: | ||
| <%@ taglib uri=" | <%@ taglib uri=" | ||
| <%@ taglib uri=" | <%@ taglib uri=" | ||
| + | |||
| < | < | ||
| <s:html locale=" | <s:html locale=" | ||
| </ | </ | ||
| - | **Step 2: Modify declarations for localized messages** 두번째 단계는 < | + | **Step 2: Modify declarations for localized messages** 두번째 단계는 < |
| + | basename을 지정하지 않으면 기본으로 저장되어있는 application의 기본 %%MessageResources%% 번들이 로드된다. | ||
| <code html> | <code html> | ||
| 行 131: | 行 147: | ||
| </ | </ | ||
| - | 일단 로드되면 모든 컴포넌트로부터 messages를 키로 JSF Expression language형식으로 접근할 수 있다. 다음은 title을 %%ResourceBundle%%을 이용하여 지역화한 예이다. | + | 일단 로드되면 모든 컴포넌트로부터 messages를 키로 JSF Expression language형식으로 접근할 수 있다.\\ |
| + | 다음은 title을 %%ResourceBundle%%을 이용하여 지역화한 예이다. | ||
| <code html> | <code html> | ||
| 行 147: | 行 164: | ||
| **Step 4: Using JSF EL for input fields** 네번째 단계는 Struts form tag를 해당 JSF form tag로 교체하는 작업이다. | **Step 4: Using JSF EL for input fields** 네번째 단계는 Struts form tag를 해당 JSF form tag로 교체하는 작업이다. | ||
| - | logonForm이라는 이름으로 ActionForm이 struts-config.xml에 저장돼있다고 가정한다. | + | logonForm이라는 이름으로 |
| <code html> | <code html> | ||
| 行 155: | 行 172: | ||
| </ | </ | ||
| - | **Step 5: Change tags for submit and reset buttons** 마지막으로 button 의 label을 지역화한다. 이때 | + | **Step 5: Change tags for submit and reset buttons** 마지막으로 button 의 label을 지역화한다. 이때 |
| - | 지금까지의 교체작업으로 바뀐 완성된 JSP는 다음과 같다. | + | 지금까지의 교체작업으로 바뀐 완성된 JSP는 다음과 같다.\\ |
| **Listing 2: Example logon JSP after migration using the Struts-Faces Integration Library** | **Listing 2: Example logon JSP after migration using the Struts-Faces Integration Library** | ||
| 行 168: | 行 185: | ||
| < | < | ||
| <s:html locale=" | <s:html locale=" | ||
| + | < | ||
| < | < | ||
| </ | </ | ||
| 行 204: | 行 222: | ||
| </ | </ | ||
| </ | </ | ||
| + | |||
| + | ===== Reference ===== | ||
| + | - JSF In Action, Kito D. Mann | ||
| + | - [[http:// | ||
| + | |||
| + | |||
| + | |||