diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..658cd9c --- /dev/null +++ b/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + de.lusiardi + webbasics1 + 1.0-SNAPSHOT + war + + Java Webprogrammierung mit Spring und Maven (Teil 1) + + 3.0 + + + + UTF-8 + + + + + + org.springframework + spring-webmvc + 3.1.2.RELEASE + jar + + + javax.servlet + javax.servlet-api + 3.0.1 + provided + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + + + \ No newline at end of file diff --git a/src/main/java/de/lusiardi/testprojekt/controller/MainController.java b/src/main/java/de/lusiardi/testprojekt/controller/MainController.java new file mode 100644 index 0000000..db10ce0 --- /dev/null +++ b/src/main/java/de/lusiardi/testprojekt/controller/MainController.java @@ -0,0 +1,14 @@ +package de.lusiardi.testprojekt.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +@Controller +public class MainController { + + @RequestMapping("view") + public ModelAndView getTest() { + return new ModelAndView("view", "key", "value"); + } +} \ No newline at end of file diff --git a/src/main/webapp/META-INF/context.xml b/src/main/webapp/META-INF/context.xml new file mode 100644 index 0000000..8e1de34 --- /dev/null +++ b/src/main/webapp/META-INF/context.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/spring-servlet.xml b/src/main/webapp/WEB-INF/spring-servlet.xml new file mode 100644 index 0000000..8f0cedc --- /dev/null +++ b/src/main/webapp/WEB-INF/spring-servlet.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..e104c7d --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,27 @@ + + + + Spring3MVC + + + index.jsp + + + + spring + + org.springframework.web.servlet.DispatcherServlet + + 1 + + + + spring + *.html + + + \ No newline at end of file diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp new file mode 100644 index 0000000..2489f31 --- /dev/null +++ b/src/main/webapp/index.jsp @@ -0,0 +1,12 @@ +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Lusiardi.de - Tutorial + + + Controller
+ + \ No newline at end of file diff --git a/src/main/webapp/views/view.jsp b/src/main/webapp/views/view.jsp new file mode 100644 index 0000000..ab1d4c8 --- /dev/null +++ b/src/main/webapp/views/view.jsp @@ -0,0 +1,12 @@ +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Lusiardi.de - Tutorial + + + ${key}
+ + \ No newline at end of file