0
我使用Spring框架,速度和sring休息完整的Web服務。 在它被使用 「」 抱怨我,我的根context.xml中被引用如下:cvc-complex-type.3.2.2:屬性'local'不允許出現在元素'ref'中。 t root-context.xml
下面是完整的代碼:
<?xml version="1.0" encoding="UTF-8"?>
HTTP://www.springframework .ORG /模式/豆類/彈簧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="[email protected]"/>
<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>[email protected]</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>
任何提示或幫助,非常感謝它!
你讀過的例外呢?這很清楚這個文件有什麼問題。 –