Spring Integration
  1. Spring Integration
  2. INT-2447

@beanname resolution not working for xslt-payload-transformer params

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1 GA
    • Fix Version/s: None
    • Component/s: XML
    • Labels:

      Description

      The @beanname resolution that noramlly works, for example in a header-enricher expression, doesn't work for an xslt-payload-transformer expression. Looking at the source, a bean resolver is never set on the EvaluationContext for the XsltPayloadTransformer class. Whereas, the header-enricher uses a different mechanism (ExpressionEvaluatingHeaderValueMessageProcessor sets the BeanFactory on the AbstractExpressionEvaluator)

      Are there other areas where SpEL is done differently, and therefore potential for differences in operation?

        Issue Links

          Activity

          Hide
          Artem Bilan added a comment -

          I think it can be simply fix in the onInit() method as it's done in AbstractWebServiceOutboundGateway or HttpRequestExecutingMessageHandler.
          However we should review usage of evaluationContext for entire framework.
          E.g. in the HttpRequestHandlingEndpointSupport we create "beanFactory" evaluationContext and than we set:

           
          evaluationContext.setRootObject(httpEntity);
          

          Is it appropriate? Maybe here we have to limit only by the level httpEntity?
          Another place that makes me doubt: ContentEnricher:

          Object value = valueExpression.getValue(this.evaluationContext, replyMessage);
          

          Why don't use here "beanFactory" evaluationContext? If I just want to enrich my payload without any gateway request I expect that this will be enough:

          <enricher>
            <property name="someProperty" expression="@someBean"/>
          </enricher>
          

          However no: I've gotten:

          No bean resolver registered in the context to resolve access to bean 'someBean'

          Show
          Artem Bilan added a comment - I think it can be simply fix in the onInit() method as it's done in AbstractWebServiceOutboundGateway or HttpRequestExecutingMessageHandler . However we should review usage of evaluationContext for entire framework. E.g. in the HttpRequestHandlingEndpointSupport we create "beanFactory" evaluationContext and than we set: evaluationContext.setRootObject(httpEntity); Is it appropriate? Maybe here we have to limit only by the level httpEntity ? Another place that makes me doubt: ContentEnricher : Object value = valueExpression.getValue( this .evaluationContext, replyMessage); Why don't use here "beanFactory" evaluationContext ? If I just want to enrich my payload without any gateway request I expect that this will be enough: <enricher> <property name= "someProperty" expression= "@someBean" /> </enricher> However no: I've gotten: No bean resolver registered in the context to resolve access to bean 'someBean'

            People

            • Assignee:
              Mark Fisher
              Reporter:
              Phil McCarley
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: