我使用了spring框架、velocity和sring rest完整的web服务。在我的root-context.xml中,它抱怨我使用了"“,它引用了以下内容:
下面是完整的代码:
<?xml version="1.0" encoding="UTF-8"?>
">http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- Root Context: defines shared resources visible to all other web components -->
<beans>
<bean id="sender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host" value="smtp.gmail.com"/>
<property name="port" value="25"/>
<property name="username" value="jadeite1000@gmail.com"/>
<property name="password" value="Jadeite1"/>
<property name="javaMailProperties">
<props>
<prop key="mail.transport.protocol">smtp</prop>
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.smtp.starttls.enable">true</prop>
<prop key="mail.debug">true</prop>
</props>
</property>
<property name="velocityEngine">
<ref bean="velocityEngine"/>
</property>
</bean>
<bean id="emailEcardConfig" class="com.email.EcardMailConfig">
<property name="from">
<value>abc@yahoo.com</value>
</property>
<property name="subject">
<value>Testing Email!</value>
</property>
<property name="htmlTemplatePath">
<value>EcardHtmlTemplate.vm</value>
</property>
<property name="velocityEngine">
<ref local="velocityEngine"/>
</property>
</bean>
<bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
<property name="resourceLoaderPath"><value>/WEB-INF/classes/velocity/</value></property>
</bean>
任何提示或帮助都是非常感谢的!
发布于 2017-11-03 20:54:57
从你的代码中删除"local“它在Spring中是不允许的
<property name="velocityEngine">
<ref local="velocityEngine"/>
</property>
https://stackoverflow.com/questions/42420524
复制相似问题