From 7eddf553ed3b2ef8ad8c4febfa32e4700fde2ef4 Mon Sep 17 00:00:00 2001 From: shing19m Date: Fri, 26 Jul 2013 19:34:09 +0200 Subject: [PATCH] Adding the original version from the blog. --- pom.xml | 53 +++++++++++++++++++ .../controller/MainController.java | 14 +++++ src/main/webapp/META-INF/context.xml | 2 + src/main/webapp/WEB-INF/spring-servlet.xml | 23 ++++++++ src/main/webapp/WEB-INF/web.xml | 27 ++++++++++ src/main/webapp/index.jsp | 12 +++++ src/main/webapp/views/view.jsp | 12 +++++ 7 files changed, 143 insertions(+) create mode 100644 pom.xml create mode 100644 src/main/java/de/lusiardi/testprojekt/controller/MainController.java create mode 100644 src/main/webapp/META-INF/context.xml create mode 100644 src/main/webapp/WEB-INF/spring-servlet.xml create mode 100644 src/main/webapp/WEB-INF/web.xml create mode 100644 src/main/webapp/index.jsp create mode 100644 src/main/webapp/views/view.jsp 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