Tag Archives: Spring

Reference java env variable in spring config

How to reference java environment variable when using spring config For example: Using Tomcat server, ${catalina.home} is one of the system variable provided by Tomcat In abc.properties file, test.ref1=${catalina.home} In context.xml (or whatever context xml file you referencing), <!– Properties –> <bean class=”org.springframework.beans.factory.config.PropertyPlaceholderConfigurer”>    <property name=”locations”>    <list>       <value>classpath:properties/abc.properties</value>    </list>  … Read More »

JavaMailSenderImpl sample

– By pass cert installation – Require logon – Dump debug message   <bean id=”javaMail” class=”org.springframework.mail.javamail.JavaMailSenderImpl”> <property name=”host” value=”${mail.host}”/> <property name=”port” value=”${mail.port}”/> <property name=”username” value=”${mail.username}”/> <property name=”password” value=”${mail.password}”/> <property name=”javaMailProperties”> <props> <prop key=”mail.smtp.auth”>true</prop> <prop key=”mail.smtp.starttls.enable”>true</prop> <prop key=”mail.smtp.ssl.trust”>*</prop> <prop key=”mail.debug”>true</prop> </props> </property> </bean>

What is @Repository advantage

The @Repository annotation is yet another stereotype that was introduced in Spring 2.0. This annotation is used to indicate that a class functions as a repository and needs to have exception translation applied transparently on it. The benefit of exception translation is that the service layer only has to deal with exceptions from Spring’s DataAccessException… Read More »