无法将值类型 'Configuration' 转换为所需类型 FreeMarkerConfigurationFactoryBean for property freeMarkerConfigura



在春季使用免费标记模板时出现以下错误:请建议。applicationContext.xml:

Dependent bean:
<bean id="domainManager" class="DomainManager">
<property name="freeMarkerConfigurationFactoryBean" ref="freeMarkerConfigurationFactoryBean"/>
<property name="sampleFile" value="sampleFile.ftl" />
</bean>
Error:
Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'freemarker.template.Configuration' to required type 'org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean' for property 'freeMarkerConfigurationFactoryBean'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'freemarker.template.Configuration' to required type 'org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean' for property 'freeMarkerConfigurationFactoryBean': no matching editors or conversion strategy found

无需在依赖bean中保留freeMarkerConfigurationFactoryBean。并用下面的豆子无论我们在哪里使用Reports,都要将模板类保持为与该类自动连接。@自动连线配置自由标记配置;freemarkerConfiguration.setClassForTemplateLoading(this.getClass((,CUSTOM_Constant.FREEMARKER_TEMP_LOCATION(;body=FreeMarkerTemplateUtils.processTemplateIntoString(freemarkConfiguration.getTemplate(fmTemplateName(,templateParameters(;

最新更新