CAS登录 - webflow修改了在检票时添加视图

时间:2016-11-15 15:11:14

标签: java cas

我在" sendTicketGrantingTicket"之后修改了login-webflow。 我进行了转换并将所有内容重定向到包含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回答&#34;成功&#34;时,一切正常。

当doBind回答&#34;问题&#34;时,我看到3按钮页面,如果我点击choiceContinue按钮,则会出现CAS错误。

ticketGrantingticketId不能为空 在org.springframework.util.Assert.notNull(Assert.java:112)

我认为必须通过grantingTicket抛出视图。以这种方式它可能在流程中出现......但是怎么样?而且,这是真的吗?

1 个答案:

答案 0 :(得分:1)

解决了我自己...... 在doBind期间保存TGT并在testMyAction.myChoiceXXX期间将其放入RequestScope