Showing posts with label Spring. Show all posts
Showing posts with label Spring. Show all posts

Spring - Sending E-Mail with MailSender

Sending email using Spring "org.springframework.mail.javamail.JavaMailSenderImpl" class simplifies the process with JavaMail API. Below example will give step by step to send email by using Gmail SMTP server configurations. pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">...

Spring + @PropertySource with @Value and Environment

In Spring we can configure our application properties in property file and by @PropertySource annotation we can configure externalized configuration file. Those property values can be read by using @Value annotation or by using...

Spring Boot + Spring Security + Serve static resources from different locations

In Spring we can configure static resources such as  images, js, and, css files from specific locations under web application root, the classpath, and other locations. Even we can configure multiple locations to server...

Spring Resource Loader with example

Spring Resource Loader is very generic and easy to load resources directly as file, url or classpath and of any file types like text, media or image. By using getResource() we can implement single...

Spring Boot + Restful Web Service + Spring Security

When we talk about Spring Boot (Simplifying Spring for Everyone) makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run". Embed Tomcat, Jetty or Undertow directly (no need to...

Spring: Data access using JdbcDaoSupport

Similar to JDBCTemplate by extending JdbcDaoSupport classes we can achieve JBDC dataaccess and just need to inject data source into EmpDaoImpl Objects through configuration file. Rest will be taken care by Spring. In our...