Giant2 Giant2 - 1 year ago 76
Java Question

CAS login-webflow modified adding view during ticket check

I modified the login-webflow after the "sendTicketGrantingTicket".
I made a transition and redirect all to a page with 3 buttons. When I click on one button I continue the flow, with other buttons make some Actions and continue or reboot to login page.
The configuration of login-webflow added is:

<action-state id="sendTicketGrantingTicket">
<evaluate expression="sendTicketGrantingTicketAction" />
<transition to="testMy" />

<action-state id="testMy">
<evaluate expression="testMyAction.doBind(ticketRegistry, flowRequestContext, messageContext)" />
<transition on="success" to="serviceCheck" />
<transition on="question" to="viewMyQuestionForm" />

<view-state id="viewMyQuestionForm" view="casMyQuestionView">
<transition on="choice1" to="myChoice1" />
<transition on="choice2" to="myChoice2" />
<transition on="choiceContinue" to="serviceCheck" />

<action-state id="myChoice1">
<evaluate expression="testMyAction.myChoice1(ticketRegistry, flowRequestContext, messageContext)" />
<transition to="viewLoginForm" />

<action-state id="myChoice2">
<evaluate expression="testMyAction.myChoice2(ticketRegistry, flowRequestContext, messageContext)" />
<transition to="serviceCheck" />

The piece of jsp is:

<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"
value="<spring:message code="screen.welcome.button.choice1" />"
tabindex="4" type="submit" />
<input class="btn-submit" style="margin-left: 3px" name="_eventId_choice2"
value="<spring:message code="screen.welcome.button.choice2" />"
tabindex="4" type="submit" />
<input class="btn-submit" style="margin-left: 3px" name="_eventId_choiceContinue"
value="<spring:message code="screen.welcome.button.choiceContinue" />"
tabindex="4" type="submit" />

Now in I have doBind, myChoice1, myChoice2 methods doing only a System.out.

When doBind answer with a "success", all goes normally.

When doBind answer "question", I see the 3 button page and, if I click on the choiceContinue button, a CAS error raise up.

ticketGrantingticketId cannot be null
at org.springframework.util.Assert.notNull(

I think must pass the grantingTicket throw the view. In this manner It could be present during the flow... But how? And, is it true?

Answer Source

Solved myself... saving the TGT during doBind and put it in RequestScope during testMyAction.myChoiceXXX

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download