spring-webflow-2

spring webflow, evaluate expression ignored in transition

▼魔方 西西 提交于 2019-12-11 01:24:14
问题 I have a flow definition as flows <view-state id="view1" view="/jsp/view1.xhtml"> <transition on="login" to="view1" > <evaluate expression="'test1'" result="viewScope.t1"/> <evaluate expression="'test2'" result="viewScope.t2"/> </transition> </view-state> View1.xhtml: ${t1}<br/> ${t2} In view1.xhtml, I printed the two variables t1 and t2, but only 'test1' is printed. The second expression is ignored in transition. Why this happened? 回答1: http://static.springsource.org/spring-webflow/docs/2.3

Spring web flow how to add flash attribute when exiting from flow to external redirect

自作多情 提交于 2019-12-10 22:47:16
问题 I'm new to Spring Web Flow (2.3.1) and this is what I'm trying to do: I have a JSP page which lists a paginated table of Books at the bottom of the page for the Author selected at the top of the page. I have a button/link at the top 'Add Book' (just below the Author drop-down) clicking which launches a Spring web flow that takes to a page where user can enter details of the Book in steps 1, 2 & 3 (in 3 different views/pages). Clicking Save creates the new Book and should take the user back to

Spring Web Flow transitions not triggered

烈酒焚心 提交于 2019-12-08 09:18:10
问题 I am using Spring Web Flow 2 and am having a basic problem getting my transitions to appropriately fire. I have done a lot of searching on the internet and have been unable to find an in-depth explanation of how transitions are triggered from the view side. I have two states: enterBookingDetails and reviewBooking. EnterBookingDetails is working fine - the page is loading and on submit event, reviewBooking is loaded. My problem is, I can't get any of the transitions from reviewBooking to work.

Relative views in view-states within a flow that is loaded from a jar-file

落花浮王杯 提交于 2019-12-07 18:04:48
问题 I have a question regarding Spring Web Flow with JSF: How can I teach Spring Web Flow to be able to load relative views like view="pages/view.xhtml" from a jar in the classpath of a tomcat webapp? After some research via google I think, that Web Flow does not support this constellation out of the box. Maybe some context, to help understanding my question: - Flows are registered in multiple FlowRegistries (I solved this problem by implementing a custom implementation, which finds all

Spring Web Flow: How to call static method from <evaluate />?

孤人 提交于 2019-12-05 10:36:18
I need to call static method of org.hibernate.Hibernate class. How to do that in element of flow ? You can use the following Spring EL construct to evaluate static methods: <evaluate expression="T(org.hibernate.Hibernate).initialize(yourObject)"/> See the appropriate Spring EL reference part: http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/expressions.html#expressions-types spring-webflow 2 uses OGNL expressions. OGNL allows for static referencing of fields and methods. To utilize it you would want to use the '@' notations. First you reference the class (with

Spring Web Flow - How can I set up unit test with values already in conversationScope?

主宰稳场 提交于 2019-12-04 13:44:29
问题 I am working on a project using Spring Web Flow 2.0. I am trying to unit test a flow that begins with a decision state. The decision state checks the value of an object that is on the conversationScope . I cannot figure out how to insert a value into the conversationScope for the unit test. I have tried: getConversationScope().put("someName", value); MockExternalContext context = new MockExternalContext(); startFlow(context); However, it seems that when I call startFlow(context) the value is

How to execute transition on value change in h:selectOneMenu?

半腔热情 提交于 2019-12-04 13:31:09
Usually i do something like below. Clicking button execute transition. <!-- view --> <h:form> <h:commandButton action="doit"> <f:ajax render="@form"/> </h:commandButton> </h:form> <!-- flow --> <transition on="doit">...</transition> How to fire a transition on change value in (for example) h:selectOneMenu ? <h:form> <h:selectOneMenu value="#{selected}"> <f:selectItems value="#{items}/> <f:ajax event="valueChange" render="@form" /> </h:selectOneMenu> </h:form> Edit: I thought about registering listener to f:ajax and prepare webflow event, but how to use that event... ? Anybody help ? <h:form>

How to handle MultipartException in Spring

人走茶凉 提交于 2019-12-04 09:35:58
My configuration is here . I made some modifications according to the answer in that post. filterMultipartResolver @Bean public StandardServletMultipartResolver filterMultipartResolver() { return new StandardServletMultipartResolver(); } AppInitializer public class AppInitializer implements WebApplicationInitializer { @Override public void onStartup(final ServletContext servletContext) throws ServletException { // Create the 'root' Spring application context final WebApplicationContext context = getContext(); // Manage the lifecycle of the root application context servletContext.addListener

Spring Web Flow - How can I set up unit test with values already in conversationScope?

扶醉桌前 提交于 2019-12-03 09:12:46
I am working on a project using Spring Web Flow 2.0. I am trying to unit test a flow that begins with a decision state. The decision state checks the value of an object that is on the conversationScope . I cannot figure out how to insert a value into the conversationScope for the unit test. I have tried: getConversationScope().put("someName", value); MockExternalContext context = new MockExternalContext(); startFlow(context); However, it seems that when I call startFlow(context) the value is cleared. I also tried: MockExternalContext context = new MockExternalContext(); setCurrentState(

spring webflow submit array with new items

我是研究僧i 提交于 2019-12-02 17:07:28
问题 I'm trying to submit array with new items using spring webflow. For eaxmple if myList has size 3 and then i add 4th item then submit fails. <c:forEach items="${myList}" var="item" varStatus="status"> <tr> <td> <input type="number" readonly class="form-control" value="${item.a}" name="myList[${status.index}].a"/> </td> <td> <input type="number" class="form-control" value="${item.b}" name="myList[${status.index}].b"/> </td> <td class="text-center"> <i class="fa fa-trash delete" data-link="$