Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm in the same fix that you're in...i have different subclasses which have corresponding action beans, but a lot of the flow is the same. In the past we have just copied and pasted...not happy with that! I have some ideas I am going to try out with using the expression language. First, I came up with an action bean factory that will return the right action bean to use for a given class, then i can call that factory to set a variable that i can use instead of the hard-coded bean name. </p> <p>Here's part of the flow:</p> <pre><code>&lt;action-state id="checkForParams"&gt; &lt;on-entry&gt; &lt;set name="flowScope.clientKey" value="requestParameters.clientKey"/&gt; &lt;set name="flowScope.viewReportBean" value="reportActionFactory.getViewBean(reportUnit)"/&gt; &lt;/on-entry&gt; &lt;evaluate expression="viewReportBean"/&gt; </code></pre> <p>The evaluate in the last line would normally refer directly to a bean, but now it refers to the result of the "set" I just did.</p> <p>Good news--the right bean gets called.</p> <p>Bad news--anything in the flow scope needs to be Serializable, so I get a NotSerializableException--arggh!</p> <p>I can try setting something on a very short-lived scope, in which case it will need to get called all the time...or I can figure out some kind of proxy which holds the real bean as a proxy declared "transient".</p> <p>BTW, I am using Spring 2.5.6 and webflow 2.0.7. Later versions may have better ways of handling this; in particular, EL's have gotten some attention, it seems. I'm still stuck with OGNL, which is the Spring 1.x EL.</p> <p>I'm sure some webflow guru knows other ways of doing things in a less clunky fashion...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload