0
我必須實現portlet間的通信功能。功能如下:Spring webflow重定向不適用於portlet
1)用戶在「createStep1.jsp」上單擊「另存爲」鏈接。
2)調用下面提到的webflow saveDraftStep1
,草稿被保存在數據庫中。
3)用戶被導航到另一個portlet myportlet
,並顯示成功保存的消息。
不知何故,webflow不會重定向到我在externalRedirect
中指定的網址。它保持在同一頁面上。下面是代碼:
<view-state id="createStep1">
<transition on="saveDraftStep1" to="redirectView" >
<evaluate expression="myAction.bindAndValidate" />
<evaluate expression="myService.saveDraft(saveCriteria, externalContext.nativeRequest,externalContext.nativeResponse)" />
</transition>
</view-state>
<end-state id="redirectView" view="externalRedirect:http://www.google.com" />
理想的情況下,我想用我的門戶網址e.g取代谷歌的網址:localhost:8080/myportlet
。
感謝您的回覆,但沒有錯誤。我甚至試圖沒有任何 「評估」 \t以下<上= 「saveDraftStep1」 過渡到= 「RedirectView的」> \t \t \t <端狀態ID = 「RedirectView的」 視圖=「externalRedirect:HTTP:// WWW。 google.com「/> – Dhaval 2013-02-26 11:11:38
因此,如果不是重定向,轉換就可以工作。或者,如果它不是一個externalRedirect? – dbreaux 2013-02-26 14:40:57
是的。轉換工作正常,沒有重定向。我現在解決了這個問題。我不得不覆蓋下面的「handleExecutionOutcome」方法。 \t公共布爾handleExecutionOutcome(FlowExecutionOutcome結果\t \t \t嘗試{ \t \t \t \t \t \t \t \t response.sendRedirect是(的redirectUrl); \t \t \t \t迴歸真實; //結果手工處理 \t \t \t}趕上(IOException異常e){ \t \t \t \t e.printStackTrace(); \t \t \t} \t \t \t的ActionRequest請求,響應ActionResponse的){ \t \t { – Dhaval 2013-03-08 00:15:58