我正在使用CAS,並且剛剛從3.4.8更新到3.5.1。已經有一千個變化,我認爲我已經處理了最多的。但是,完成時的外部重定向似乎以某種方式被破壞。它只是循環回到login-webflow的開始。這怎麼會發生?Spring webflow externalRedirect重啓相同流程
這是越來越達成的最終狀態:
<!-- The "redirect" end state allows CAS to properly end the workflow while
still redirecting the user back to the service required. -->
<end-state id="redirectView"
view="externalRedirect:${requestScope.response.url}" />
我知道這是越來越達成,因爲我在這個方法中設置斷點(的org.springframework.webflow.action.ExternalRedirectAction
):
protected Event doExecute(RequestContext context) throws Exception {
String resourceUri = (String) this.resourceUri.getValue(context);
context.getExternalContext().requestExternalRedirect(resourceUri);
return success();
}
如果我檢查在這個方法返回之前的resourceUri的值,我看到這個請求應該被重定向到的URI:
http://mycompany.com:8080/c/portal/login?redirect=%2Fweb%2Fguest%2Fhome&ticket=ST-4-jVOtEEZcy9bXdb4xiV3l-cas
但是,如果我只是從該斷點運行,而不是被重定向到該頁面,則相同的login-webflow會重新開始。這裏發生了什麼?我應該在哪裏看?任何提示或調試?
--------------- UPDATE ---------------
所以使得0修改代碼後,只是增加一些額外的斷點,它現在按預期工作。我不知道這裏發生了什麼,但我終於找到了實際重定向發生的地方。對於那些有興趣誰,重定向發生在:
org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handleFlowExecutionResult(
FlowExecutionResult result, ServletExternalContext context,
HttpServletRequest request, HttpServletResponse response, FlowHandler handler)
我有完全相同的問題,上週。 externalRedirect重定向到相同的流量,無論我是作爲redirectView。我改變了我的代碼,並使用一個輸出將url發送給父流,該父流執行了相同的重定向並且工作。很奇怪... – rptmat57
@ rptmat57,出於好奇,你使用的是eclipse,maven(m2e,m2e-wtp)和嵌入式tomcat嗎?我有這個設置很多問題,其中許多存在爲非常奇怪... – Lucas
我使用eclipse,嵌入式tomcat和螞蟻,但沒有maven。我試圖清理tomcat目錄,沒有解決問題。這是一個非常奇怪的問題,因爲我有其他流程使用重定向相同的方式,他們工作正常 – rptmat57