spring-webflow

Spring Webflow DataBinding to immutable objects via a constructor?

北战南征 提交于 2019-11-30 10:08:43
Is there any way of using an immutable object as a model within a view-state in Spring webflow? I know Spring webflow generally tends towards setters for this kind of thing, but I was wondering if anyone knew of a custom DataBinder or WebDataBinder that could handle binding the data using a constructor? I'm also aware there's this (SPR-1488) JIRA task against the problem, which advocated direct field access. Do people advocate this way of doing things? To me it doesn't quite feel right. Thanks, Stuart I have put an example of how you can do this using Jackson's ObjectMapper (which besides JSON

Spring Security : Bypass login form

天涯浪子 提交于 2019-11-30 07:12:38
I want to bypass the login form for a Spring webflow (Spring 2.0.5) application under certain scenarios (so the login form is presented for normal users but when the URL is like http://server.com/myspringapp/fakelogin?username=FakeUser&password=FakePassword then the user should not be presented the login form but just authenticated internally based on request parameters and then taken to the secure page). So I don't want Preauthenticastion, rather a transparent authentication on special occassions (when the URL is as mentioned above). I saw threads such as http://forum.springsource.org

Catch “dead” session in Spring webflow

被刻印的时光 ゝ 提交于 2019-11-29 16:50:10
I want to catch the exception thrown when I loose my session, not only because a session timeout (for reports for example). Also I want that this handler will handle only that specific exception and will not be a global exceptions handler or any thing like this. Basically, I want to catch exception org.springframework.web.HttpSessionRequiredException . Selwyn With any of the proposed solutions below you should be able to handle the exceptions and perform logic on them. Possible Solutions: 1. You can add a FlowExecutionListenerAdapter that will listen to all exceptions thrown and then you can

Printing log from flow.xml

我怕爱的太早我们不能终老 提交于 2019-11-29 16:27:27
I am working on a web application with spring web flow. While I am working on a flow.xml file I have get a decision state on it like this - <decision-state id="checkPermissin"> <if test="requestParameters.canApprove" then="approve" else="warning" /> </decision-state> When a request comes to the flow.xml then it get the request parameter canApprove from it and test whether it is true or false. Then it goes to the either of approve or warning state. My question is - can I log/print the status of canApprove from the flow.xml file? Selwyn You can add an on-exit tag to the end of the 'decision

Spring Webflow - How to Get List of FLOW IDs

不打扰是莪最后的温柔 提交于 2019-11-29 16:12:59
What is the best way to get the full list of FLOW IDs generated by Spring Webflow? Here is my configuration: <webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices" base-path="/WEB-INF/pageFlows"> <webflow:flow-location-pattern value="/**/*-flow.xml"/> </webflow:flow-registry> [UPDATE 1] I should clarify that I want to do this in Java code, not by inspecting my configuration. [UPDATE 2] answer: requestContext.getActiveFlow().getApplicationContext() Prasad List of flow ids can be identified by the way they are defined in flow-registry. By default, flows will be

Spring webflow - how to pass the session in evaluate expression?

别等时光非礼了梦想. 提交于 2019-11-29 15:29:35
I'm using spring webflow, but I need to access my HttpSession in a method that's accessed using a transition ==> evaluate expression. (so in the xml file containing my flow) So far I've yet to find a way to actually pass it to my method. I've taken a look at the flowrequestcontext but so far I haven't found a way yet. I think you don't need to pass it as soon as you pass the RequestContext. You can try this: public class MyAction extends MultiAction{ public Event myMethod(RequestContext context){ HttpSession session = ((HttpServletRequest)context.getExternalContext().getNativeRequest())

File Upload using Spring WebFlow 2.4.0, parameter not binded

落爺英雄遲暮 提交于 2019-11-29 12:48:34
I'm using Spring Framework 4.1.5, Spring Security 4.0.0.RC2, Spring Webflow 2.4.0.RELEASE and Tomcat 8.0.15. I followed the example in the webflow documentation , but I can't get the file in my form bean. The form <form:form action="${flowExecutionUrl}" method="post" commandName="fileForm" enctype="multipart/form-data"> <form:input type="file" value="" path="multipartFileUpload"/> <button type="submit" name="_eventId_forward"><spring:message code="signup.forward"/></button> <sec:csrfInput/> </form:form> The form bean public class FileForm implements Serializable { private static final long

Ajax + Spring Webflow

故事扮演 提交于 2019-11-29 10:09:38
First, I am using spring webflow and some spring javascript to make ajax calls easier. As of right now, I am having ajax make a call into webflow to display the appropriate fragment. So I am attempting to use Spring.AjaxEventDecoration for my ajax needs for my application. However, I am having some trouble with this method and webflow and from what I can tell, there are very few examples available to work with. On a side note, I am not using a form or a select box. I thought I would mention this since every example I've found has used a form/form submit with onlick event or select box with

Spring Security : Bypass login form

血红的双手。 提交于 2019-11-29 09:49:53
问题 I want to bypass the login form for a Spring webflow (Spring 2.0.5) application under certain scenarios (so the login form is presented for normal users but when the URL is like http://server.com/myspringapp/fakelogin?username=FakeUser&password=FakePassword then the user should not be presented the login form but just authenticated internally based on request parameters and then taken to the secure page). So I don't want Preauthenticastion, rather a transparent authentication on special

Trying to run junit test on service level of Spring WebFlow Project. Assume$AssumptionViolatedException

大憨熊 提交于 2019-11-29 08:04:07
I am trying to run my first test with junit on a Spring Web Flow Project from within Eclipse and also from the console with mvn test and but give me the same error. java.lang.NoClassDefFoundError: org/junit/Assume$AssumptionViolatedException Here is my java code: package org.uftwf.memberinquiry.text; import junit.framework.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org