我在“sendTicketGrantingTicket”之后修改了登录网络流程。 我进行了转换并将所有内容重定向到带有 3 个按钮的页面。当我单击一个按钮时,我会继续流程,使用其他按钮执行一些操作并继续或重新启动到登录页面。 添加的login-webflow的配置为:
<action-state id="sendTicketGrantingTicket">
<evaluate expression="sendTicketGrantingTicketAction" />
<transition to="testMy" />
</action-state>
<action-state id="testMy">
<evaluate expression="testMyAction.doBind(ticketRegistry, flowRequestContext, messageContext)" />
<transition on="success" to="serviceCheck" />
<transition on="question" to="viewMyQuestionForm" />
</action-state>
<view-state id="viewMyQuestionForm" view="casMyQuestionView">
<transition on="choice1" to="myChoice1" />
<transition on="choice2" to="myChoice2" />
<transition on="choiceContinue" to="serviceCheck" />
</view-state>
<action-state id="myChoice1">
<evaluate expression="testMyAction.myChoice1(ticketRegistry, flowRequestContext, messageContext)" />
<transition to="viewLoginForm" />
</action-state>
<action-state id="myChoice2">
<evaluate expression="testMyAction.myChoice2(ticketRegistry, flowRequestContext, messageContext)" />
<transition to="serviceCheck" />
</action-state>
jsp的片段是:
<input type="hidden" name="lt" value="${loginTicket}" />
<input type="hidden" name="execution" value="${flowExecutionKey}" />
<input class="btn-submit" style="margin-left: 3px" name="_eventId_choice1"
accesskey="l"
value="<spring:message code="screen.welcome.button.choice1" />"
tabindex="4" type="submit" />
<input class="btn-submit" style="margin-left: 3px" name="_eventId_choice2"
accesskey="l"
value="<spring:message code="screen.welcome.button.choice2" />"
tabindex="4" type="submit" />
<input class="btn-submit" style="margin-left: 3px" name="_eventId_choiceContinue"
accesskey="l"
value="<spring:message code="screen.welcome.button.choiceContinue" />"
tabindex="4" type="submit" />
现在在 testMyAction.java 中,我有 doBind、myChoice1、myChoice2 方法,仅执行 System.out。
当 doBind 回答“成功”时,一切正常。
当 doBind 回答“问题”时,我会看到 3 个按钮页面,如果我单击 choiceContinue 按钮,则会出现 CAS 错误。
ticketGrantingticketId 不能为空 在 org.springframework.util.Assert.notNull(Assert.java:112)
我认为必须通过 grantingTicket 抛出 View 。以这种方式,它可以在流动过程中出现……但是如何呢?而且,这是真的吗?
最佳答案
解决了我自己... 在 doBind 期间保存 TGT 并在 testMyAction.myChoiceXXX 期间将其放入 RequestScope
关于java - CAS登录-webflow修改添加检票时查看,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40613327/