Getting full string stack trace including inner exception

public static String joinStackTrace(Throwable e) {        StringWriter writer = null;        try {            writer = new StringWriter();            joinStackTrace(e, writer);            return writer.toString();        } finally {            if (writer != null)                try {                    writer.close();          ... [Read More]

Use Spring JavaMailSender and Freemarker to send Email by template

  <bean class="org.springframework.mail.javamail.JavaMailSenderImpl" id="mailSender">  <property name="host" value="${mail.host}"></property>  <property name="username" value="${mail.username}"></property>  <property name="password" value="${mail.password}"></property>  <property name="javaMailProperties">    <props>      <prop key="mail.smtp.auth">${mail.smtp.auth}</prop>      <prop key="mail.smtp.port">${mail.smtp.port}</prop>      <prop key="mail.smtp.host">${mail.host}</prop>      <prop key="mail.smtp.starttls.enable">true</prop>    </props>  </property></bean>   <bean class="org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean" id="freemarkerConfiguration">  <property name="preferFileSystemAccess" value="false"></property>  <property name="templateLoaderPath" value="classpath:/"></property></bean>        import java.util.Map; import javax.mail.internet.MimeMessage; import org.springframework.mail.javamail.JavaMailSender;import org.springframework.mail.javamail.MimeMessageHelper;import org.springframework.mail.javamail.MimeMessagePreparator;import org.springframework.ui.freemarker.FreeMarkerTemplateUtils; import freemarker.template.Configuration;  @Service("mailService")public class MailService... [Read More]

freemarker template engine ------try catch if else loop

  i think one of best solution for generate code is using template engine like freemarker.for using try catch or if else and some other expression in it using like this<#attempt> attempt block <#recover> recover block </#attempt><#if x == 1> x is 1 <#elseif x == 2> x is 2... [Read More]

Test markdown

Each post also has a subtitle

You can write regular markdown here and Jekyll will automatically convert it to a nice webpage. I strongly encourage you to take 5 minutes to learn how to write in markdown - it’ll teach you how to transform regular text into bold/italics/headings/tables/etc. [Read More]