Announcement Announcement Module
Collapse
No announcement yet.
Property injection for handlers not working? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Property injection for handlers not working?

    Hi,

    I have a problem with the properties injection. My handler is defined as a bean within Spring (2.5.6):

    PHP Code:
      <bean id="sofaCommunicator" 
            
    class="com.company.sofa.SofaCommunicatorImpl">
        <
    property name="hostname" value="${couch.config.host}/>
        <
    property name="hostport" value="${couch.config.port}/>
        <
    property name="username" value="${couch.web.username}"/>
        <
    property name="password" value="${couch.web.password}"/>
        <
    property name="application" value="${couch.db.application}"/>
        <
    property name="userobj" value="${couch.db.userobj}"/>
      </
    bean>
      
      <
    bean id="vitaHandler"
            
    class="com.company.appwizard.VitaHandler">
        <
    property name="sofaComm" ref="sofaCommunicator" />
      </
    bean
    When using the handler within my flow like this:

    PHP Code:
      <view-state id="vita">
        <var 
    name="vitaHandler"
             
    class="com.company.appwizard.VitaHandler" />
        <
    transition on="submit" to="nextStep" >
          <
    evaluate expression="vitaHandler.process()" />
        </
    transition>
        <
    transition on="overview" to="overview" />   
      </
    view-state
    Unluckily the injected "sofaComm" seems to be null, crashing like

    2011-03-18 10:59:06,746 WARN 723811282@qtp-1429913313-6 com.coremedia.cae.webflow.AbstractFlowViewControll er - Error handling flow request: 'Exception thrown executing [AnnotatedAction@607c2e83 targetAction = [EvaluateAction@78d1cbf1 expression = vitaHandler.processFile(), resultExposer = [null]], attributes = map[[empty]]] in state 'vita' of flow 'com.company.flows/ApplicationWizard' -- action execution attributes were 'map[[empty]]'': /webapp-dev/servlet/webflow/bewerbung/11558/assistent.html
    org.springframework.webflow.execution.ActionExecut ionException: Exception thrown
    executing [AnnotatedAction@607c2e83 targetAction = [EvaluateAction@78d1cbf1 expression = vitaHandler.process(), resultExposer = [null]], attributes =
    map[[empty]]] in state 'vita' of flow 'com.company.flows/ApplicationWizard' -- action execution attributes were 'map[[empty]]'

    Can anyone help me on this issue?

    Regs,
    Rob

  • #2
    Try removing your <var> declaration. All spring beans should be available to you by their spring bean names. So really all you need is to refer to them and (as long as the name is not defined in one of the flow scopes) it should be resolved by Spring.

    Comment


    • #3
      So if you had your lottery winings would you buy land in west coast or north carolina mountain property for sale for a winter retreat?

      Comment

      Working...
      X