AndreiM
AndreiM

Reputation: 4598

How to set a literal String flowScope value on-exception?

In my Spring web flow app, one of my action-state transitions looks like this:

    <transition on-exception="com.foo.BarException" to="barView">
        <set name="flowScope.error" value="foo.bar" type="string" />
    </transition>

I would like to set flowScope.error to the literal String "foo.bar", but Spring interprets this as a reference to the foo object's bar attribute. How can I force Spring to take the String literally?

Upvotes: 5

Views: 5967

Answers (1)

AndreiM
AndreiM

Reputation: 4598

I figured it out: the value needs needs to be enclosed in single quotes:

<set name="flowScope.error" value="'foo.bar'" type="string" />

Upvotes: 10

Related Questions