diff --git a/spring-mustache/.gitignore b/spring-mustache/.gitignore
new file mode 100644
index 0000000000..2af7cefb0a
--- /dev/null
+++ b/spring-mustache/.gitignore
@@ -0,0 +1,24 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+nbproject/private/
+build/
+nbbuild/
+dist/
+nbdist/
+.nb-gradle/
\ No newline at end of file
diff --git a/spring-mustache/pom.xml b/spring-mustache/pom.xml
new file mode 100644
index 0000000000..e671672b72
--- /dev/null
+++ b/spring-mustache/pom.xml
@@ -0,0 +1,60 @@
+
+
+ 4.0.0
+
+ com.baeldung
+ spring-mustache
+ 0.0.1-SNAPSHOT
+ jar
+
+ spring-mustache
+ Demo project for Spring Boot
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 1.5.4.RELEASE
+
+
+
+
+ UTF-8
+ UTF-8
+ 1.8
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-mustache
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.webjars
+ bootstrap
+ 3.3.7
+
+
+ org.fluttercode.datafactory
+ datafactory
+ 0.8
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
+
+
diff --git a/spring-mustache/src/main/java/com/baeldung/springmustache/SpringMustacheApplication.java b/spring-mustache/src/main/java/com/baeldung/springmustache/SpringMustacheApplication.java
new file mode 100644
index 0000000000..d4338ffd7d
--- /dev/null
+++ b/spring-mustache/src/main/java/com/baeldung/springmustache/SpringMustacheApplication.java
@@ -0,0 +1,34 @@
+package com.baeldung.springmustache;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.mustache.MustacheEnvironmentCollector;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.core.env.Environment;
+
+import com.samskivert.mustache.Mustache;
+
+@SpringBootApplication
+@ComponentScan(basePackages = { "com.baeldung" })
+public class SpringMustacheApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(SpringMustacheApplication.class, args);
+ }
+
+ @Bean
+ public Mustache.Compiler mustacheCompiler(Mustache.TemplateLoader templateLoader, Environment environment) {
+
+ MustacheEnvironmentCollector collector = new MustacheEnvironmentCollector();
+ collector.setEnvironment(environment);
+
+ Mustache.Compiler compiler = Mustache.compiler()
+ .defaultValue("Some Default Value")
+ .withLoader(templateLoader)
+ .withCollector(collector);
+ return compiler;
+
+ }
+}
+
diff --git a/spring-mustache/src/main/java/com/baeldung/springmustache/controller/ArticleController.java b/spring-mustache/src/main/java/com/baeldung/springmustache/controller/ArticleController.java
new file mode 100644
index 0000000000..e0db127d66
--- /dev/null
+++ b/spring-mustache/src/main/java/com/baeldung/springmustache/controller/ArticleController.java
@@ -0,0 +1,50 @@
+package com.baeldung.springmustache.controller;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.stream.IntStream;
+
+import org.fluttercode.datafactory.impl.DataFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.ModelAndView;
+
+import com.baeldung.springmustache.model.Article;
+
+@Controller
+public class ArticleController {
+
+ @RequestMapping("/article")
+ public ModelAndView displayArticle(Map model) {
+
+ List articles = new LinkedList<>();
+ IntStream.range(0, 10)
+ .forEach(count -> {
+ articles.add(generateArticle("Article Title "+count));
+ });
+
+ Map modelMap = new HashMap<>();
+ modelMap.put("articles", articles);
+
+ return new ModelAndView("index", modelMap);
+ }
+
+ private Article generateArticle(String title) {
+ Article article = new Article();
+ DataFactory factory = new DataFactory();
+ article.setTitle(title);
+ article.setBody(
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur faucibus tempor diam. In molestie arcu eget ante facilisis sodales. Maecenas porta tellus sapien, eget rutrum nisi blandit in. Mauris tempor auctor ante, ut blandit velit venenatis id. Ut varius, augue aliquet feugiat congue, arcu ipsum finibus purus, dapibus semper velit sapien venenatis magna. Nunc quam ex, aliquet at rutrum sed, vestibulum quis libero. In laoreet libero cursus maximus vulputate. Nullam in fermentum sem. Duis aliquam ullamcorper dui, et dictum justo placerat id. Aliquam pretium orci quis sapien convallis, non blandit est tempus.");
+ article.setPublishDate(factory.getBirthDate()
+ .toString());
+ article.setAuthor(factory.getName());
+ return article;
+
+ }
+}
+
+
diff --git a/spring-mustache/src/main/java/com/baeldung/springmustache/model/Article.java b/spring-mustache/src/main/java/com/baeldung/springmustache/model/Article.java
new file mode 100644
index 0000000000..78b08f877f
--- /dev/null
+++ b/spring-mustache/src/main/java/com/baeldung/springmustache/model/Article.java
@@ -0,0 +1,41 @@
+package com.baeldung.springmustache.model;
+
+public class Article {
+ private String title;
+ private String body;
+ private String author;
+ private String publishDate;
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getBody() {
+ return body;
+ }
+
+ public void setBody(String body) {
+ this.body = body;
+ }
+
+ public String getAuthor() {
+ return author;
+ }
+
+ public void setAuthor(String author) {
+ this.author = author;
+ }
+
+ public String getPublishDate() {
+ return publishDate;
+ }
+
+ public void setPublishDate(String publishDate) {
+ this.publishDate = publishDate;
+ }
+
+}
diff --git a/spring-mustache/src/main/resources/application.properties b/spring-mustache/src/main/resources/application.properties
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/spring-mustache/src/main/resources/templates/error/error.html b/spring-mustache/src/main/resources/templates/error/error.html
new file mode 100644
index 0000000000..fa29db41c4
--- /dev/null
+++ b/spring-mustache/src/main/resources/templates/error/error.html
@@ -0,0 +1,9 @@
+
+
+
+
+
+ Something went wrong: {{status}} {{error}}
+
+
+
\ No newline at end of file
diff --git a/spring-mustache/src/main/resources/templates/index.html b/spring-mustache/src/main/resources/templates/index.html
new file mode 100644
index 0000000000..bda60f9d8f
--- /dev/null
+++ b/spring-mustache/src/main/resources/templates/index.html
@@ -0,0 +1,9 @@
+{{>layout/header}}
+
+ {{>layout/article}}
+
+
+
+
+{{>layout/footer}}
diff --git a/spring-mustache/src/main/resources/templates/layout/article.html b/spring-mustache/src/main/resources/templates/layout/article.html
new file mode 100644
index 0000000000..9d573580d3
--- /dev/null
+++ b/spring-mustache/src/main/resources/templates/layout/article.html
@@ -0,0 +1,8 @@
+
+ {{#articles}}
+
{{title}}
+
{{publishDate}}
+
{{author}}
+
{{body}}
+ {{/articles}}
+
\ No newline at end of file
diff --git a/spring-mustache/src/main/resources/templates/layout/footer.html b/spring-mustache/src/main/resources/templates/layout/footer.html
new file mode 100644
index 0000000000..04f34cac54
--- /dev/null
+++ b/spring-mustache/src/main/resources/templates/layout/footer.html
@@ -0,0 +1,2 @@
+
+