();
+
+ list.add(new Tutorial(1, "Guava", "Introduction to Guava","GuavaAuthor"));
+ list.add(new Tutorial(2, "Android", "Introduction to Android","AndroidAuthor"));
+ return list;
+ }
+}
diff --git a/spring-mvc-velocity/src/main/webapp/WEB-INF/fragments/footer.vm b/spring-mvc-velocity/src/main/webapp/WEB-INF/fragments/footer.vm
new file mode 100644
index 0000000000..41bb36ce5e
--- /dev/null
+++ b/spring-mvc-velocity/src/main/webapp/WEB-INF/fragments/footer.vm
@@ -0,0 +1,4 @@
+
+ @Copyright baeldung.com
+
\ No newline at end of file
diff --git a/spring-mvc-velocity/src/main/webapp/WEB-INF/fragments/header.vm b/spring-mvc-velocity/src/main/webapp/WEB-INF/fragments/header.vm
new file mode 100644
index 0000000000..8fffa6cdab
--- /dev/null
+++ b/spring-mvc-velocity/src/main/webapp/WEB-INF/fragments/header.vm
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/spring-mvc-velocity/src/main/webapp/WEB-INF/layouts/layout.vm b/spring-mvc-velocity/src/main/webapp/WEB-INF/layouts/layout.vm
new file mode 100644
index 0000000000..203e675cfb
--- /dev/null
+++ b/spring-mvc-velocity/src/main/webapp/WEB-INF/layouts/layout.vm
@@ -0,0 +1,22 @@
+
+
+ Spring & Velocity
+
+
+
+ #parse("/WEB-INF/fragments/header.vm")
+
+
+
+
+
+
+ $screen_content
+
+
+
+
+ #parse("/WEB-INF/fragments/footer.vm")
+
+
+
\ No newline at end of file
diff --git a/spring-mvc-velocity/src/main/webapp/WEB-INF/mvc-servlet.xml b/spring-mvc-velocity/src/main/webapp/WEB-INF/mvc-servlet.xml
new file mode 100644
index 0000000000..8b4fd570fe
--- /dev/null
+++ b/spring-mvc-velocity/src/main/webapp/WEB-INF/mvc-servlet.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spring-mvc-velocity/src/main/webapp/WEB-INF/spring-context.xml b/spring-mvc-velocity/src/main/webapp/WEB-INF/spring-context.xml
new file mode 100644
index 0000000000..2f3b0f19bb
--- /dev/null
+++ b/spring-mvc-velocity/src/main/webapp/WEB-INF/spring-context.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spring-mvc-velocity/src/main/webapp/WEB-INF/views/index.vm b/spring-mvc-velocity/src/main/webapp/WEB-INF/views/index.vm
new file mode 100644
index 0000000000..d1ae0b02cb
--- /dev/null
+++ b/spring-mvc-velocity/src/main/webapp/WEB-INF/views/index.vm
@@ -0,0 +1,19 @@
+Index
+
+Tutorials list
+
+
+ | Tutorial Id |
+ Tutorial Title |
+ Tutorial Description |
+ Tutorial Author |
+
+#foreach($tut in $tutorials)
+
+ | $tut.tutId |
+ $tut.title |
+ $tut.description |
+ $tut.author |
+
+#end
+
\ No newline at end of file
diff --git a/spring-mvc-velocity/src/main/webapp/WEB-INF/web.xml b/spring-mvc-velocity/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..72050c0d37
--- /dev/null
+++ b/spring-mvc-velocity/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,32 @@
+
+
+
+ Spring MVC Velocity
+
+
+ mvc
+ org.springframework.web.servlet.DispatcherServlet
+
+ contextConfigLocation
+ /WEB-INF/mvc-servlet.xml
+
+ 1
+
+
+
+ mvc
+ /*
+
+
+
+ contextConfigLocation
+ /WEB-INF/spring-context.xml
+
+
+
+ org.springframework.web.context.ContextLoaderListener
+
+
\ No newline at end of file
diff --git a/spring-mvc-velocity/src/test/java/com/baeldung/mvc/velocity/test/NavigationControllerTest.java b/spring-mvc-velocity/src/test/java/com/baeldung/mvc/velocity/test/NavigationControllerTest.java
new file mode 100644
index 0000000000..bcd42ae47d
--- /dev/null
+++ b/spring-mvc-velocity/src/test/java/com/baeldung/mvc/velocity/test/NavigationControllerTest.java
@@ -0,0 +1,53 @@
+package com.baeldung.mvc.velocity.test;
+
+
+import static org.junit.Assert.*;
+
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.ui.ExtendedModelMap;
+import org.springframework.ui.Model;
+import org.mockito.Mockito;
+import org.mockito.runners.MockitoJUnitRunner;
+import com.baeldung.mvc.velocity.controller.MainController;
+import com.baeldung.mvc.velocity.domain.Tutorial;
+import com.baeldung.mvc.velocity.service.TutorialsService;
+
+
+@RunWith(MockitoJUnitRunner.class)
+public class NavigationControllerTest {
+
+ private MainController mainController;
+
+ private TutorialsService tutorialsService;
+
+
+ private Model model;
+
+ @Before
+ public final void setUp() throws Exception {
+ model = new ExtendedModelMap();
+ mainController = Mockito.spy(new MainController());
+ tutorialsService = Mockito.mock(TutorialsService.class);
+
+ mainController.setTutService(tutorialsService);
+
+ }
+
+ @Test
+ public final void shouldGoToTutorialListView() {
+ Mockito.when(tutorialsService.listTutorials()).thenReturn(TutorialDataFactory.createTutorialList());
+ final String view = mainController.listTutorialsPage(model);
+ final List tutorialListAttribute = (List) model.asMap().get("tutorials");
+
+ assertEquals("index", view);
+ assertNotNull(tutorialListAttribute);
+ }
+
+
+
+
+}
diff --git a/spring-mvc-velocity/src/test/java/com/baeldung/mvc/velocity/test/TutorialDataFactory.java b/spring-mvc-velocity/src/test/java/com/baeldung/mvc/velocity/test/TutorialDataFactory.java
new file mode 100644
index 0000000000..4e76d0ea5b
--- /dev/null
+++ b/spring-mvc-velocity/src/test/java/com/baeldung/mvc/velocity/test/TutorialDataFactory.java
@@ -0,0 +1,44 @@
+package com.baeldung.mvc.velocity.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.baeldung.mvc.velocity.domain.Tutorial;
+
+public final class TutorialDataFactory {
+
+ public static final Integer TEST_TUTORIAL_ID = 1;
+
+ public static final String TEST_TUTORIAL_AUTHOR = "TestAuthor";
+
+ public static final String TEST_TUTORIAL_TITLE = "Test Title";
+
+ public static final String TEST_TUTORIAL_DESCRIPTION = "Test Description";
+
+
+ private TutorialDataFactory() {
+ }
+
+ public static Tutorial createByDefault() {
+ final Tutorial tutorial = new Tutorial();
+ tutorial.setTutId(TEST_TUTORIAL_ID);
+ tutorial.setAuthor(TEST_TUTORIAL_AUTHOR);
+ tutorial.setTitle(TEST_TUTORIAL_TITLE);
+ tutorial.setDescription(TEST_TUTORIAL_DESCRIPTION);
+ return tutorial;
+ }
+
+ public static Tutorial create(final Integer id , final String title) {
+ final Tutorial tutorial = createByDefault();
+ tutorial.setTutId(id);
+ tutorial.setTitle(title);
+ return tutorial;
+ }
+
+ public static List createTutorialList() {
+ final List tutorialList = new ArrayList();
+ tutorialList.add(createByDefault());
+ return tutorialList;
+ }
+
+}
diff --git a/xml/pom.xml b/xml/pom.xml
index 9d88bd75eb..d204eea45f 100644
--- a/xml/pom.xml
+++ b/xml/pom.xml
@@ -27,12 +27,6 @@
2.0.6
-
- xerces
- xercesImpl
- 2.9.1
-
-
commons-io
diff --git a/xml/src/test/resources/example_new.xml b/xml/src/test/resources/example_new.xml
index 020760fdd3..646d938869 100644
--- a/xml/src/test/resources/example_new.xml
+++ b/xml/src/test/resources/example_new.xml
@@ -1,10 +1,9 @@
-
-
-
-
- XML with Dom4J
- XML handling with Dom4J
- 14/06/2016
- Dom4J tech writer
-
-
+
+
+
+ Jaxb author
+ 04/02/2015
+ XML Binding with Jaxb
+ XML with Jaxb
+
+