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