user1671106
user1671106

Reputation: 203

webflow evaluate expression doesn't call method

in the flow:

<action-state id="create">
        <evaluate expression="operatore_rer" result="flowScope.operatore_rer" />
        <evaluate expression="mainService.getComuni()" result="flowScope.comuni_list" />
        <transition to="nuovo-operatore-rer" />
    </action-state>

evaluate expression doesn't call the method mainService.getComuni()

where and how i have to declare mainService????

if i declare this in applicationContext:

<bean id="mainService" class="com.aieap.services.MainService" />

this is the error:

GRAVE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mainService' defined in ServletContext resource [/WEB-INF/dispatch-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.aieap.services.MainService]: Specified class is an interface

help me

Upvotes: 0

Views: 1544

Answers (2)

Sujana
Sujana

Reputation: 26

Set @Service("mainService") annotation to the class that implements the MainService interface and refer that class in the bean instead of interface. In that way the bean get's initialized and you can call that in your web flow.

Upvotes: 1

Doug Breaux
Doug Breaux

Reputation: 5105

mainService has to be a bean known to Spring. Either through a Spring XML configuration file (which can be imported into your flow.xml file via <bean-import> or loaded through web.xml), or through annotation-based bean definition.

Upvotes: 0

Related Questions