一個頁面流在第一次使用時,內(nèi)部屬性currentpage并沒有指定頁面,所以避免在begin方法里使用return-to: current page用法.同時在用的時候注意頁面流的工作方式
問題描述:
Error message like below in Web Page is displayed: Page Flow: /com/xxxx/xxx/xxx.jpf Action: update Page Flow Error - No Relevant Page You have tried to return to a recent page in the current page flow through return-to="currentPage", but there is no appropriate page. Exception's stack trace: Exception: No previous page for return-to="currentPage" on action create in page flow /com/gems/mt/web/CreateReleaseCntr/CreateReleaseCntrController.jpf. com.bea.wlw.netui.pageflow.NoPreviousPageException: No relevant page for return-to="currentPage" on action create in page flow /com/gems/mt/web/CreateReleaseCntr/CreateReleaseCntrController.jpf. at com.bea.wlw.netui.pageflow.FlowController.doReturnToPage(FlowController.java:1328) at com.bea.wlw.netui.pageflow.FlowController.forwardTo(FlowController.java:1023) at com.bea.wlw.netui.pageflow.PageFlowController.forwardTo(PageFlowController.java:606) at com.bea.wlw.netui.pageflow.FlowController.internalExecute(FlowController.java:765) ...原因分析和解決方法:
When a new page flow is created and its current page is null (it mean you visit at the fist time), so such an exception like NoPreviousPageException occur if you use return-to="currentPage". if a new page flow finish a successful forward, it will treat last page as current page so that we can use current page to display error message conveniently. Solution: ensure page flow finish a successful forward and use current page again. You can also use path="specificPage.jsp" instead of return-to="currentPage" if your original return-to is just one specific page.