Spring WebFLow 处理 JSP 中的请求

发布于 2024-07-10 17:39:16 字数 158 浏览 7 评论 0原文

我是 Spring Webflow 的新手,我正在使用自定义 FlowHandler

我可以访问相应的控制器,但如果在请求对象中设置属性,我无法获取它JSP 即查看状态

我该如何进行呢?

I am newbie to Spring Webflow, I have am using Custom FlowHandler

I can reach the respective Controller, but if set an attribute in a request Object I don't get it in JSP that is View state.

How can I proceed in this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

浪推晚风 2024-07-17 17:39:16

你不应该在 spring webflow 中为你的请求属性设置任何东西 - 没有必要,除了 webflow 做了一些内部请求重定向,并且可能你的属性是丢失的。

您在流程中创建的所有变量都可以在视图中使用,就像通过向请求添加属性来设置它们一样。 是通过标签创建它们还是通过标签执行一些服务调用来创建

you shouldn't set anything to your request attributes in spring webflow - there is no need, besides webflow does some internal request redirecting and probably your attributes are los.

all the variables you create in the flow are available in view as if they were set by adding attribute to request. wether you create them via tag or create by executing some service calls via tag

友谊不毕业 2024-07-17 17:39:16
<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>
<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>
最单纯的乌龟 2024-07-17 17:39:16

嘿 Miceuz 感谢您的回复.....

<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>

在流程开始时,我调用一个扩展 FormAction 的 Contorller

在firsthit 方法中,我设置一个请求属性,如下所示

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

如果我尝试在 JSP 中访问,则将其设置为 null...如你说Webflow有内部重定向..那么我如何访问控制器中设置的值?

Hey Miceuz thanks for Replying .....

<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>

On start of the flow I am invoking a Contorller which extends FormAction

In firsthit Method I am setting a request Attribute as below

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

If i try to access in JSP , getting it as null... as you said Webflow has internal redirect.. Then how can I access the Value that has been set in Controller?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文