Hi, all:
I am tring to use spring to create some beans in the context, part of my applicationContext.xml is like following, if I use the commented out part, then always there are some issues, it does not work, but If I use the non-commented out part, it will works fine, the only difference is commented-part is using the properties from some other file, but non-commented part is directly using the value.
I think maybe the problem is from spring, when it call the setter method, if it is string, it does not do trim operation, so that is why some wired problems happening.
Any suggestion or help will be appreciated.
Thanks
Jack
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>myserver.properties</value>
</list>
</property>
</bean>
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailS enderImpl">
<!-- for some reason , this way does not work, I believe this is bug from setter method, it doesn't do a trim after get the value from here
<property name="host">
<value>${mail.host}</value>
</property>
<property name="username">
<value>${mail.username}</value>
</property>
<property name="password">
<value>${mail.password}</value>
</property>
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">${mail.smtp.auth}</prop>
<prop key="mail.smtp.timeout">${mail.smtp.timeout}</prop>
</props>
</property>
-->
<property name="host"><value>smtp.mydomain.com</value></property>
<property name="username"><value>aaaaa</value></property>
<property name="password"><value>bbbbb</value></property>
<property name="javaMailProperties"><props><prop key="mail.smtp.auth">true</prop></props></property>
</bean>
also
<bean id="cronTrigger1" class="org.springframework.scheduling.quartz.CronT riggerBean">
<property name="jobDetail" ref="scheduleJob"/>
<!--<property name="cronExpression"><value>${report.scheduler.cr onexpression}<value/></property>-->
<property name="cronExpression" value="30 * * * * ?"/>
</bean>
part of myserver.properties file:
mail.host=smtp.mydomain.com
mail.username=aaaaa
mail.password=bbbbb
mail.smtp.auth=true
mail.smtp.timeout=25000
mail.default.from=report@
report.generation.cronexpression = 0 53 * * * ?
report.scheduler.cronexpression = 30 * * * * ?


Reply With Quote