spring-webflow

Configure Spring Web Flow with Java configuration

谁都会走 提交于 2019-12-10 16:34:09
问题 I am using Spring 3.1 and want to include Spring Web Flow 2.3. One thing I really like about Spring is that you can leave off the XML configuration in favour of Java-only configuration using @Configuration and @Bean annotations. However, I have not yet found out how to configure Web Flow this way. The docs that turned up on my Google searches all referred to XML configuration only. Is it possible, does anyone have any pointers? EDIT: I was not asking about the flow definition, but rather for

Chinese character encoding?

雨燕双飞 提交于 2019-12-10 15:39:51
问题 I have a use case where i am submitting parameters to spring controller through post request. In the controller, i am reading parameters and performing some actions. After that i am sending those parameters as part of request params to other URL. Here i am not able to deal with chinese characters. It is getting garbled. Actions i am doing now : 1) I am passing below Chinese text as param with name subject from HTML page(this is not JSP). 以下便是有关此问题的所有信息 2) When i read this value from request

How to change default format in StringToDate? Spring WebFlow

爷,独闯天下 提交于 2019-12-10 13:13:56
问题 Default date format in Spring WebFlow is "yyyy-MM-dd". How to change to another format? "dd.mm.yyyy" for example. 回答1: Sorry for the late post but here is what you have to do. Spring Webflow does custom Data Binding. Its similar to how Spring MVC does it. The difference though is where it handles it. Spring MVC handles it on the controller level ( using the @InitBinder ). Spring webflow does it on the binding level. Before executing a transition webflow will bind all parameter values to the

Grails Webflow: Access flow scope outside of action or transition states

寵の児 提交于 2019-12-10 11:49:39
问题 I want to call a subflow where the controller is not known. It is passed in parameters to beginFlow and I save that in flow scope. Inside goToForm I'd like to call use the controller that is saved in flow.theController. def beginFlow = { enter { action { if (params?.redirectTo != null) { String flow.theController = params.redirectTo } if ( flow.theController() ) { success() } } on("success").to("beginPage") } beginPage { on('next').to('goToForm') } goToForm { // I'd like this: // subflow

Grails Webflow - keeping things *out* of flow scope

不羁岁月 提交于 2019-12-10 10:06:16
问题 I'm missing something.... I have a Grails webflow that looks like this:- def childFlow = { start { action { def targets = [] Target.list().each {target -> targets.add(new TargetCommand(name: target.name, id: target.id)) } log.debug "targets are $targets" [children: targets] } on('success').to('selectChild') } ... TargetCommand is serializable. but I get this error:- Caused by: java.io.NotSerializableException: com.nerderg.groupie.donate.Target For some reason the "target" object that is

Grails web flow

℡╲_俬逩灬. 提交于 2019-12-10 09:47:37
问题 Is there any way to pass model data to a view state? Consider the following example view state: class BookController { def shoppingCartFlow = { showProducts { on("checkout").to "enterPersonalDetails" on("continueShopping").to "displayCatalogue" } } } If I want to pass the data model [products: Product.list()] to showProducts.gsp, is there any way to do this apart from preceding the view state with an action state that stores the model in flow scope? Thanks, Don 回答1: Hmm, it's been a bit since

How to send parameter to fileUploadListener in PrimeFaces fileUpload

徘徊边缘 提交于 2019-12-09 15:41:51
问题 When I create a model I would like to save images for a model. I am using PrimeFaces fileUpload component. When I save pictures I want to know to which model particular image refers to. That's why I need to send id of a model to backing bean. Is there any possibility to send id of model to fileUploadListener ? <h:form enctype="multipart/form-data"> <p:panelGrid columns="2"> <h:outputLabel for="hotelName" value="#{msg.hotelName}"/> <p:inputText value="#{apartmentNew.name}" id="hotelName"/> <h

Spring 3 JSF 2 integration example needed

微笑、不失礼 提交于 2019-12-09 06:53:46
问题 i want to Integrate Spring 3, Web Flow 2, JSF 2 together and i need you to recommend me a good tutorial or example, thanks in advance. UPDATE: i used following example, and it worked fine with me with no problems: http://www.mkyong.com/jsf2/jsf-2-0-spring-hibernate-integration-example/ but it doesn't use spring web flow and i don't know if there are any problems with this approach. 回答1: I recently did a template setup of Spring MVC 3 using Spring controllers and JSF 2 as the view generator.

Prevent Cross-Site Request Forgery in a Spring WebFlow Application

百般思念 提交于 2019-12-09 06:15:21
问题 I'm looking for a (hopefully straightforward) way to add CSRF protection to an application build on Spring WebFlow 2. An approach that migrates well to Spring WebFlow 3 (when released) is preferred. 回答1: The easiest way to prevent CSRF it to check the referer request.getHeader("referer"); to make sure the request is coming from the same domain. This method is covered by the CSRF Prevention Cheat Sheet. Its common to see this CSRF protection system on embedded network hardware with limited

Debugging inside a JSP page?

折月煮酒 提交于 2019-12-08 11:22:13
问题 I'm using Java 1.6, Spring 3.4, Spring Webflow 2.3.2 and Tomcat 7. I'm trying to debug a JSP page which uses EL expressions like: <c:if test="${myObject.myThing == SomeClass.ENUMVALUE.myvalue}" > The myObject object is passed in as the Webflow model object. I have a breakpoint set on this line and I am able to reach it and break on it, but anything I try to "watch" or "evaluate" gives me an error message. I get either ${myObject.myThing == SomeClass.ENUMVALUE.myvalue}: Invalid Expression