Spring Request to handle WebFLow in JSP

I am new to Spring Webflow

, I am using CustomFlowHandler

I can contact the appropriate controller, but if I set the attribute on the request object, I don't get it in the JSP that View state

.

How can I proceed?

+1


source to share


3 answers


you shouldn't be specifying anything on request attributes in spring webflow - not necessary, besides, webflow does internal request redirection and your attributes are probably los.



all the variables you create in the stream are available in the view as if they were set by adding an attribute to the request. if you create them via tag or create by doing some housekeeping with tag

0


source


<on-start>      
   <evaluate expression="XXXControllerwsf.firstHit(flowRequestContext)" result="flowScope.res"/>
</on-start>
<decision-state id="urlcheck">
    <if test="flowScope.res.reurl== 'splash' " then="splash" else="change"/>
</decision-state>   
<view-state id="change" view="${flowScope.res.reurl}">       
</view-state>

<view-state id="splash" view="forward:/XXX/jsp1/XXXchange1.jsp">
    <transition on="buy" to="SignInSignUp"/>
</view-state>
</flow>

      



0


source


Hey Miceuz thanks for the answer .....

<on-start>      
    <evaluate expression="XXXXControllerwsf.firstHit(flowRequestContext)" result="flowScope.res"/>
</on-start>
<decision-state id="urlcheck">
    <if test="flowScope.res.reurl== 'splash' " then="splash" else="change"/>
</decision-state>   
<view-state id="change" view="${flowScope.res.reurl}">       
</view-state>
<view-state id="splash" view="forward:/Jahia/jsp1/XXXXchange1.jsp">
   <transition on="buy" to="SignInSignUp"/>
</view-state>
</flow>

      

At the start of the thread I call Contorller which extends FormAction

In the first method, I am setting the request attribute as below

request.setAttribute("rajan", "rajanweww");
request.setAttribute("rajan", Object);

      

If I try to access the JSP by getting it as null ... as you said Webflow has an internal redirect .. Then how can I access the value set in the controller?

-1


source







All Articles