diff --git a/webjars/webjarsdemo/pom.xml b/webjars/webjarsdemo/pom.xml new file mode 100644 index 0000000000..80e4f0a42a --- /dev/null +++ b/webjars/webjarsdemo/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + com.baeldung + webjarsdemo + 0.0.1-SNAPSHOT + jar + + webjarsdemo + Demo project for webjars using Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 1.3.5.RELEASE + + + + + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.webjars + bootstrap + 3.3.4 + + + org.webjars + jquery + 2.1.4 + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git a/webjars/webjarsdemo/src/main/java/com/baeldung/TestController.java b/webjars/webjarsdemo/src/main/java/com/baeldung/TestController.java new file mode 100644 index 0000000000..19a1c18c6b --- /dev/null +++ b/webjars/webjarsdemo/src/main/java/com/baeldung/TestController.java @@ -0,0 +1,15 @@ +package com.baeldung; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +public class TestController { + + @RequestMapping(value="/") + public String welcome(Model model){ + return "index"; + } + +} diff --git a/webjars/webjarsdemo/src/main/java/com/baeldung/WebjarsdemoApplication.java b/webjars/webjarsdemo/src/main/java/com/baeldung/WebjarsdemoApplication.java new file mode 100644 index 0000000000..c14dc682af --- /dev/null +++ b/webjars/webjarsdemo/src/main/java/com/baeldung/WebjarsdemoApplication.java @@ -0,0 +1,12 @@ +package com.baeldung; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class WebjarsdemoApplication { + + public static void main(String[] args) { + SpringApplication.run(WebjarsdemoApplication.class, args); + } +} diff --git a/webjars/webjarsdemo/src/main/resources/templates/index.html b/webjars/webjarsdemo/src/main/resources/templates/index.html new file mode 100644 index 0000000000..046d21600a --- /dev/null +++ b/webjars/webjarsdemo/src/main/resources/templates/index.html @@ -0,0 +1,19 @@ + + + WebJars Demo + + + + +

+
+ × + Success! It is working as we expected. +
+
+ + + + + + \ No newline at end of file diff --git a/webjars/webjarsdemo/src/test/java/com/baeldung/WebjarsdemoApplicationTests.java b/webjars/webjarsdemo/src/test/java/com/baeldung/WebjarsdemoApplicationTests.java new file mode 100644 index 0000000000..284cda5d31 --- /dev/null +++ b/webjars/webjarsdemo/src/test/java/com/baeldung/WebjarsdemoApplicationTests.java @@ -0,0 +1,18 @@ +package com.baeldung; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.SpringApplicationConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.web.WebAppConfiguration; + +@RunWith(SpringJUnit4ClassRunner.class) +@SpringApplicationConfiguration(classes = WebjarsdemoApplication.class) +@WebAppConfiguration +public class WebjarsdemoApplicationTests { + + @Test + public void contextLoads() { + } + +}