aantono
Apr 6th, 2006, 03:51 PM
Keith,
I have the following requirement: when going through the flow, some actions require you to login in order to proceed. To handle that case I use ACEGI on the back-end (via the FlowListener) that basically checks for every flow and throws a Veto exception when the login is needed. In the flow definition I catch that exception and go to a login sub-flow. Inside that subflow I have a view that needs to render the page, but I want that to be https instead of http. Given the fact that I am already inside the request, the way I do it is by doing a redirect, the problem is, I can't specify the protocol with wich I want the redirect to proceed, or at least I can't seem to figure out how to do it. What would you suggest to handle this problem?
Thanks,
Alex
Flow Def. snippets
---------------------------------------------
<action-state id="addToCart">
<attribute name="authentication" value="ROLE_BOOK" />
<action bean="cartAction"/>
<transition on="success" to="cart"/>
</action-state>
<subflow-state id="login" flow="login">
<transition on="success" to="addToCart"/>
</subflow-state>
<exception-handler on="org.springframework.webflow.execution.EnterStateVe toException" to="login"/>
=== Login Flow ===
<flow start-state="renderLogin">
<view-state id="renderLogin" view="redirect:login">
<entry-actions>
<action bean="loginAction" method="setupForm"/>
</entry-actions>
<transition on="submit" to="bindLoginCriteria"/>
</view-state>
<action-state id="bindLoginCriteria">
<action bean="loginAction" method="bindAndValidate"/>
<transition on="success" to="doLogin"/>
<transition on="error" to="renderLogin"/>
</action-state>
<action-state id="doLogin">
<action bean="loginAction"/>
<transition on="success" to="success"/>
<transition on="error" to="renderLogin"/>
</action-state>
<end-state id="success" view="externalRedirect:/"/>
</flow>
I have the following requirement: when going through the flow, some actions require you to login in order to proceed. To handle that case I use ACEGI on the back-end (via the FlowListener) that basically checks for every flow and throws a Veto exception when the login is needed. In the flow definition I catch that exception and go to a login sub-flow. Inside that subflow I have a view that needs to render the page, but I want that to be https instead of http. Given the fact that I am already inside the request, the way I do it is by doing a redirect, the problem is, I can't specify the protocol with wich I want the redirect to proceed, or at least I can't seem to figure out how to do it. What would you suggest to handle this problem?
Thanks,
Alex
Flow Def. snippets
---------------------------------------------
<action-state id="addToCart">
<attribute name="authentication" value="ROLE_BOOK" />
<action bean="cartAction"/>
<transition on="success" to="cart"/>
</action-state>
<subflow-state id="login" flow="login">
<transition on="success" to="addToCart"/>
</subflow-state>
<exception-handler on="org.springframework.webflow.execution.EnterStateVe toException" to="login"/>
=== Login Flow ===
<flow start-state="renderLogin">
<view-state id="renderLogin" view="redirect:login">
<entry-actions>
<action bean="loginAction" method="setupForm"/>
</entry-actions>
<transition on="submit" to="bindLoginCriteria"/>
</view-state>
<action-state id="bindLoginCriteria">
<action bean="loginAction" method="bindAndValidate"/>
<transition on="success" to="doLogin"/>
<transition on="error" to="renderLogin"/>
</action-state>
<action-state id="doLogin">
<action bean="loginAction"/>
<transition on="success" to="success"/>
<transition on="error" to="renderLogin"/>
</action-state>
<end-state id="success" view="externalRedirect:/"/>
</flow>