하도 Webwork쪽 가이드를 안하다 보니. 다 까먹는다.. 평상시에 좋은 팁있으면 올려야곘다.

 

 

    <action name="search" class="com.google.search.SearchKorea">  

       <result name="success" type="chain">SearchInUSA</result>  

       <result name="fail" type="dispatcher">/monitor/showdefault.jsp</result>  

    </action>  

 

패키지 이름이 "/"라고 가정하면.

 

search라는 Action이 호출될 떄, 바인됭 클래스 (com.google.search.SearchKorea)를 실행시켜서 return 결과값에 맞춰 동작을 시키는데.

 

chain은 보통 Action을 호출한다. (이는 스트러츠 1과 비슷하도록 한 것)

그리고, 실패하면 단순히 jsp를 호출하도록 한다.

 

 

chain type은 Action을 다시 호출할 수 있다. 그러나 dispatcher type은 jsp를 호출한다.

 

 

참고로 .. Action 잘못 호출하면.. 이렇게 된다. 무한 반복 회출될 수 있다..

서로가 서로를 호출하는 구조가 되지 않도록 한다.

 

com.opensymphony.xwork.XworkException: infinite recursion detected
 at com.opensymphony.xwork.ActionChainResult.execute(ActionChainResult.java:137)
 at com.opensymphony.xwork.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:312)
 at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:207)
 at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:113)
 at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:233)

 

 

Posted by '김용환'
,