Revision history [back]

click to hide/show revision 1
initial version

answered 2019-10-22 12:27:21 +0800

cor3000 gravatar image cor3000

ZK Team

ZK's @WireVariable-annotation specifies a VariableResolver, which is wiring by name.

What's definitely missing is, giving your configuration a matching bean id/name:

@Configuration('myConfig')

so that it matches your annotated variable.

@WireVariable
private AppConfig myConfig;

Or you can rename your variable to match the automatic bean id assigned by spring.

@WireVariable
private AppConfig appConfig;

https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/context/annotation/AnnotationBeanNameGenerator.html

ZK's @WireVariable-annotation specifies a VariableResolver, which is wiring by name.

What's definitely missing is, giving your configuration a matching bean id/name:

@Configuration('myConfig')

so that it matches your annotated variable.

@WireVariable
private AppConfig myConfig;

Or you can rename your variable to match the automatic bean id assigned by spring.

@WireVariable
private AppConfig appConfig;

https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/context/annotation/AnnotationBeanNameGenerator.html

ZK's @WireVariable-annotation specifies a VariableResolver, which is wiring by name.

What's missing is, giving your configuration a matching bean id/name:

@Configuration('myConfig')
@Configuration("myConfig")

so that it matches your annotated variable.

@WireVariable
private AppConfig myConfig;

Or you can rename your variable to match the automatic bean id assigned by spring.

@WireVariable
private AppConfig appConfig;

https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/context/annotation/AnnotationBeanNameGenerator.html

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More