9

In a flow definition, I am trying to access a bean that has a dot in its ID

(example: <evaluate expression="bus.MyServiceFacade.someAction()" />

However, it does not work. SWF tries to find a bean "bus" instead.

Initially, I got over it by using a helper bean to load the required bean, but the solution is inelegant and uncomfortable. The use of alias'es is also out of the question since the beans are part of a large system and I cannot tamper with them.

In a nutshell, none of the solution allowed me to refernce the bean directly by using its original name. Is that even possible in the current SWF release?

Ryan Ransford
  • 3,224
  • 28
  • 35
Arnelism
  • 1,484
  • 1
  • 15
  • 22

4 Answers4

10

I was able to do this by using both the bean accessor (@) symbol and single-quotes around the name of the bean.

Using your example: #{@'bus.MyServiceFacade'.someAction()}

Ryan Ransford
  • 3,224
  • 28
  • 35
1

This is a restriction of the EL parser (generally either OGNL or jboss-el for Spring Web Flow). EL uses dot notation for parsing the navigation chain,causing the initial behavior you describe (attempting to find the "bus" bean).

Stevi Deter
  • 1,653
  • 12
  • 16
0

Try:

['bus.MyServiceFacade'].someAction()

or

'bus.MyServiceFacade'.someAction()

This may work, or it may not...but similar things are used in the Expression Language for JSPs.

MetroidFan2002
  • 29,217
  • 16
  • 62
  • 80
-1

In my experience, anything with a getter method can be accessed via dot notation. In your example, whatever object is being represented by the bus bean needs to have a getServiceFacade method and that the object returned by getServiceFacade would need to have a getSomeAction method.

Owen
  • 22,247
  • 13
  • 42
  • 47