From 6da0057ef5f5329e8bd473d4a1e846cd77aa2493 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 00:18:21 +0800 Subject: [PATCH 01/33] Create pom.xml --- spring-mvc-handlers/pom.xml | 1 + 1 file changed, 1 insertion(+) create mode 100644 spring-mvc-handlers/pom.xml diff --git a/spring-mvc-handlers/pom.xml b/spring-mvc-handlers/pom.xml new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/spring-mvc-handlers/pom.xml @@ -0,0 +1 @@ + From 576533baf53579964e43f008506fa2181026ead4 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 00:22:42 +0800 Subject: [PATCH 02/33] Updated the file --- spring-mvc-handlers/pom.xml | 68 +++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/spring-mvc-handlers/pom.xml b/spring-mvc-handlers/pom.xml index 8b13789179..b77aaa3173 100644 --- a/spring-mvc-handlers/pom.xml +++ b/spring-mvc-handlers/pom.xml @@ -1 +1,69 @@ + + 4.0.0 + com.baeldung + SpringMVCHandlers + war + 0.0.1-SNAPSHOT + SpringMVCHandlers Maven Webapp + http://maven.apache.org + + 4.3.4.RELEASE + 3.5.1 + + + + + javax.servlet + javax.servlet-api + 3.1.0 + + + commons-logging + commons-logging + 1.2 + + + org.springframework + spring-webmvc + ${springframework.version} + + + org.springframework + spring-context + ${springframework.version} + + + org.springframework + spring-core + ${springframework.version} + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-war-plugin + 2.4 + + src/main/webapp + springMVCHandlers + false + + + + + springMVCHandlers + + From 2e7d05440c3a3306fd85305cc6e6de2f434a170d Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 00:52:02 +0800 Subject: [PATCH 03/33] Delete pom.xml --- spring-mvc-handlers/pom.xml | 69 ------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 spring-mvc-handlers/pom.xml diff --git a/spring-mvc-handlers/pom.xml b/spring-mvc-handlers/pom.xml deleted file mode 100644 index b77aaa3173..0000000000 --- a/spring-mvc-handlers/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - 4.0.0 - com.baeldung - SpringMVCHandlers - war - 0.0.1-SNAPSHOT - SpringMVCHandlers Maven Webapp - http://maven.apache.org - - - 4.3.4.RELEASE - 3.5.1 - - - - - javax.servlet - javax.servlet-api - 3.1.0 - - - commons-logging - commons-logging - 1.2 - - - org.springframework - spring-webmvc - ${springframework.version} - - - org.springframework - spring-context - ${springframework.version} - - - org.springframework - spring-core - ${springframework.version} - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-war-plugin - 2.4 - - src/main/webapp - springMVCHandlers - false - - - - - springMVCHandlers - - From 7dee229acdd6f66f36825e69f3df2d780a5f6d48 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 01:51:57 +0800 Subject: [PATCH 04/33] Initial Commit --- SpringMVCHandlers/.classpath | 27 +++++++ SpringMVCHandlers/.project | 42 +++++++++++ SpringMVCHandlers/pom.xml | 70 +++++++++++++++++++ ...MethodHandlerAdapterExampleController.java | 17 +++++ ...appingHandlerAdapterExampleController.java | 17 +++++ ...rollerHandlerAdapterExampleController.java | 21 ++++++ .../src/main/resources/spring-servlet.xml | 31 ++++++++ .../src/main/webapp/WEB-INF/Greeting.jsp | 5 ++ .../src/main/webapp/WEB-INF/web.xml | 19 +++++ 9 files changed, 249 insertions(+) create mode 100644 SpringMVCHandlers/.classpath create mode 100644 SpringMVCHandlers/.project create mode 100644 SpringMVCHandlers/pom.xml create mode 100644 SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java create mode 100644 SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java create mode 100644 SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java create mode 100644 SpringMVCHandlers/src/main/resources/spring-servlet.xml create mode 100644 SpringMVCHandlers/src/main/webapp/WEB-INF/Greeting.jsp create mode 100644 SpringMVCHandlers/src/main/webapp/WEB-INF/web.xml diff --git a/SpringMVCHandlers/.classpath b/SpringMVCHandlers/.classpath new file mode 100644 index 0000000000..c4978de982 --- /dev/null +++ b/SpringMVCHandlers/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SpringMVCHandlers/.project b/SpringMVCHandlers/.project new file mode 100644 index 0000000000..25a99f0f7f --- /dev/null +++ b/SpringMVCHandlers/.project @@ -0,0 +1,42 @@ + + + SpringMVCHandlers + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/SpringMVCHandlers/pom.xml b/SpringMVCHandlers/pom.xml new file mode 100644 index 0000000000..0074898767 --- /dev/null +++ b/SpringMVCHandlers/pom.xml @@ -0,0 +1,70 @@ + + 4.0.0 + com.baeldung + SpringMVCHandlers + war + 0.0.1-SNAPSHOT + SpringMVCHandlers Maven Webapp + http://maven.apache.org + + + 4.3.4.RELEASE + 3.5.1 + 2.6 + + + + + javax.servlet + javax.servlet-api + 3.1.0 + + + commons-logging + commons-logging + 1.2 + + + org.springframework + spring-webmvc + ${springframework.version} + + + org.springframework + spring-context + ${springframework.version} + + + org.springframework + spring-core + ${springframework.version} + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + src/main/webapp + springMVCHandlers + false + + + + + springMVCHandlers + + diff --git a/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java b/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java new file mode 100644 index 0000000000..9837467e19 --- /dev/null +++ b/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java @@ -0,0 +1,17 @@ +package com.baeldung.spring.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; + +@Controller +public class AnnotationMethodHandlerAdapterExampleController { + @RequestMapping("/annotedName") + public ModelAndView getEmployeeName() { + ModelAndView model = new ModelAndView("Greeting"); + + model.addObject("message", "Dinesh"); + + return model; + } +} diff --git a/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java b/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java new file mode 100644 index 0000000000..012ba555dc --- /dev/null +++ b/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java @@ -0,0 +1,17 @@ +package com.baeldung.spring.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; + +@Controller +public class RequestMappingHandlerAdapterExampleController { + @RequestMapping("/requestName") + public ModelAndView getEmployeeName() { + ModelAndView model = new ModelAndView("Greeting"); + + model.addObject("message", "Madhwal"); + + return model; + } +} diff --git a/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java b/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java new file mode 100644 index 0000000000..59d932812c --- /dev/null +++ b/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java @@ -0,0 +1,21 @@ +package com.baeldung.spring.controller; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.mvc.AbstractController; + +public class SimpleControllerHandlerAdapterExampleController extends +AbstractController { + +@Override +protected ModelAndView handleRequestInternal(HttpServletRequest arg0, + HttpServletResponse arg1) throws Exception { +ModelAndView model = new ModelAndView("Greeting"); + +model.addObject("message", "Dinesh Madhwal"); + +return model; +} +} \ No newline at end of file diff --git a/SpringMVCHandlers/src/main/resources/spring-servlet.xml b/SpringMVCHandlers/src/main/resources/spring-servlet.xml new file mode 100644 index 0000000000..eb42f89847 --- /dev/null +++ b/SpringMVCHandlers/src/main/resources/spring-servlet.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SpringMVCHandlers/src/main/webapp/WEB-INF/Greeting.jsp b/SpringMVCHandlers/src/main/webapp/WEB-INF/Greeting.jsp new file mode 100644 index 0000000000..820d2f380f --- /dev/null +++ b/SpringMVCHandlers/src/main/webapp/WEB-INF/Greeting.jsp @@ -0,0 +1,5 @@ + + +

Hello ${message}

+ + \ No newline at end of file diff --git a/SpringMVCHandlers/src/main/webapp/WEB-INF/web.xml b/SpringMVCHandlers/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..d47deec14e --- /dev/null +++ b/SpringMVCHandlers/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,19 @@ + + + + spring + org.springframework.web.servlet.DispatcherServlet + + contextConfigLocation + classpath*:spring-servlet.xml + + 1 + + + spring + / + + \ No newline at end of file From 99b82f0ee71588c227a7706f56bfeeae0aad434a Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 02:13:06 +0800 Subject: [PATCH 05/33] initial commit --- SpringMVCHandlers/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 SpringMVCHandlers/.gitignore diff --git a/SpringMVCHandlers/.gitignore b/SpringMVCHandlers/.gitignore new file mode 100644 index 0000000000..b83d22266a --- /dev/null +++ b/SpringMVCHandlers/.gitignore @@ -0,0 +1 @@ +/target/ From 12b4cad504dd68fe25a55c16e22c6b21edfa8504 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 02:29:37 +0800 Subject: [PATCH 06/33] Initial Commit --- spring-mvc-handlers/.classpath | 27 +++++++ spring-mvc-handlers/.project | 42 +++++++++++ spring-mvc-handlers/pom.xml | 70 +++++++++++++++++++ ...MethodHandlerAdapterExampleController.java | 17 +++++ ...appingHandlerAdapterExampleController.java | 17 +++++ ...rollerHandlerAdapterExampleController.java | 21 ++++++ .../src/main/resources/spring-servlet.xml | 31 ++++++++ .../src/main/webapp/WEB-INF/Greeting.jsp | 5 ++ .../src/main/webapp/WEB-INF/web.xml | 19 +++++ 9 files changed, 249 insertions(+) create mode 100644 spring-mvc-handlers/.classpath create mode 100644 spring-mvc-handlers/.project create mode 100644 spring-mvc-handlers/pom.xml create mode 100644 spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java create mode 100644 spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java create mode 100644 spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java create mode 100644 spring-mvc-handlers/src/main/resources/spring-servlet.xml create mode 100644 spring-mvc-handlers/src/main/webapp/WEB-INF/Greeting.jsp create mode 100644 spring-mvc-handlers/src/main/webapp/WEB-INF/web.xml diff --git a/spring-mvc-handlers/.classpath b/spring-mvc-handlers/.classpath new file mode 100644 index 0000000000..c4978de982 --- /dev/null +++ b/spring-mvc-handlers/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spring-mvc-handlers/.project b/spring-mvc-handlers/.project new file mode 100644 index 0000000000..25a99f0f7f --- /dev/null +++ b/spring-mvc-handlers/.project @@ -0,0 +1,42 @@ + + + SpringMVCHandlers + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/spring-mvc-handlers/pom.xml b/spring-mvc-handlers/pom.xml new file mode 100644 index 0000000000..0074898767 --- /dev/null +++ b/spring-mvc-handlers/pom.xml @@ -0,0 +1,70 @@ + + 4.0.0 + com.baeldung + SpringMVCHandlers + war + 0.0.1-SNAPSHOT + SpringMVCHandlers Maven Webapp + http://maven.apache.org + + + 4.3.4.RELEASE + 3.5.1 + 2.6 + + + + + javax.servlet + javax.servlet-api + 3.1.0 + + + commons-logging + commons-logging + 1.2 + + + org.springframework + spring-webmvc + ${springframework.version} + + + org.springframework + spring-context + ${springframework.version} + + + org.springframework + spring-core + ${springframework.version} + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + src/main/webapp + springMVCHandlers + false + + + + + springMVCHandlers + + diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java new file mode 100644 index 0000000000..9837467e19 --- /dev/null +++ b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java @@ -0,0 +1,17 @@ +package com.baeldung.spring.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; + +@Controller +public class AnnotationMethodHandlerAdapterExampleController { + @RequestMapping("/annotedName") + public ModelAndView getEmployeeName() { + ModelAndView model = new ModelAndView("Greeting"); + + model.addObject("message", "Dinesh"); + + return model; + } +} diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java new file mode 100644 index 0000000000..012ba555dc --- /dev/null +++ b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java @@ -0,0 +1,17 @@ +package com.baeldung.spring.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; + +@Controller +public class RequestMappingHandlerAdapterExampleController { + @RequestMapping("/requestName") + public ModelAndView getEmployeeName() { + ModelAndView model = new ModelAndView("Greeting"); + + model.addObject("message", "Madhwal"); + + return model; + } +} diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java new file mode 100644 index 0000000000..59d932812c --- /dev/null +++ b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java @@ -0,0 +1,21 @@ +package com.baeldung.spring.controller; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.mvc.AbstractController; + +public class SimpleControllerHandlerAdapterExampleController extends +AbstractController { + +@Override +protected ModelAndView handleRequestInternal(HttpServletRequest arg0, + HttpServletResponse arg1) throws Exception { +ModelAndView model = new ModelAndView("Greeting"); + +model.addObject("message", "Dinesh Madhwal"); + +return model; +} +} \ No newline at end of file diff --git a/spring-mvc-handlers/src/main/resources/spring-servlet.xml b/spring-mvc-handlers/src/main/resources/spring-servlet.xml new file mode 100644 index 0000000000..eb42f89847 --- /dev/null +++ b/spring-mvc-handlers/src/main/resources/spring-servlet.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-mvc-handlers/src/main/webapp/WEB-INF/Greeting.jsp b/spring-mvc-handlers/src/main/webapp/WEB-INF/Greeting.jsp new file mode 100644 index 0000000000..820d2f380f --- /dev/null +++ b/spring-mvc-handlers/src/main/webapp/WEB-INF/Greeting.jsp @@ -0,0 +1,5 @@ + + +

Hello ${message}

+ + \ No newline at end of file diff --git a/spring-mvc-handlers/src/main/webapp/WEB-INF/web.xml b/spring-mvc-handlers/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..d47deec14e --- /dev/null +++ b/spring-mvc-handlers/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,19 @@ + + + + spring + org.springframework.web.servlet.DispatcherServlet + + contextConfigLocation + classpath*:spring-servlet.xml + + 1 + + + spring + / + + \ No newline at end of file From c4b48da506eca6adc6f0588b6e348f6f7562553c Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 02:31:00 +0800 Subject: [PATCH 07/33] Delete pom.xml --- SpringMVCHandlers/pom.xml | 70 --------------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 SpringMVCHandlers/pom.xml diff --git a/SpringMVCHandlers/pom.xml b/SpringMVCHandlers/pom.xml deleted file mode 100644 index 0074898767..0000000000 --- a/SpringMVCHandlers/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - 4.0.0 - com.baeldung - SpringMVCHandlers - war - 0.0.1-SNAPSHOT - SpringMVCHandlers Maven Webapp - http://maven.apache.org - - - 4.3.4.RELEASE - 3.5.1 - 2.6 - - - - - javax.servlet - javax.servlet-api - 3.1.0 - - - commons-logging - commons-logging - 1.2 - - - org.springframework - spring-webmvc - ${springframework.version} - - - org.springframework - spring-context - ${springframework.version} - - - org.springframework - spring-core - ${springframework.version} - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-war-plugin - ${maven-war-plugin.version} - - src/main/webapp - springMVCHandlers - false - - - - - springMVCHandlers - - From fbafde657ee96a3ecab86765547ed20034333a81 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 02:31:09 +0800 Subject: [PATCH 08/33] Delete .project --- SpringMVCHandlers/.project | 42 -------------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 SpringMVCHandlers/.project diff --git a/SpringMVCHandlers/.project b/SpringMVCHandlers/.project deleted file mode 100644 index 25a99f0f7f..0000000000 --- a/SpringMVCHandlers/.project +++ /dev/null @@ -1,42 +0,0 @@ - - - SpringMVCHandlers - - - - - - org.eclipse.wst.jsdt.core.javascriptValidator - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.wst.validation.validationbuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jem.workbench.JavaEMFNature - org.eclipse.wst.common.modulecore.ModuleCoreNature - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - org.eclipse.wst.common.project.facet.core.nature - org.eclipse.wst.jsdt.core.jsNature - - From 0ece2fe9eaa1a64925e5563e6f936807a14f7c58 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 02:31:19 +0800 Subject: [PATCH 09/33] Delete .gitignore --- SpringMVCHandlers/.gitignore | 1 - 1 file changed, 1 deletion(-) delete mode 100644 SpringMVCHandlers/.gitignore diff --git a/SpringMVCHandlers/.gitignore b/SpringMVCHandlers/.gitignore deleted file mode 100644 index b83d22266a..0000000000 --- a/SpringMVCHandlers/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ From ceec40b0d8d7bb8d01b1312f853cee41e968d4e8 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 02:31:27 +0800 Subject: [PATCH 10/33] Delete .classpath --- SpringMVCHandlers/.classpath | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 SpringMVCHandlers/.classpath diff --git a/SpringMVCHandlers/.classpath b/SpringMVCHandlers/.classpath deleted file mode 100644 index c4978de982..0000000000 --- a/SpringMVCHandlers/.classpath +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - From eecf3befb39980d3e4eb48cb566295602c75b3b3 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 02:31:37 +0800 Subject: [PATCH 11/33] Delete Greeting.jsp --- SpringMVCHandlers/src/main/webapp/WEB-INF/Greeting.jsp | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 SpringMVCHandlers/src/main/webapp/WEB-INF/Greeting.jsp diff --git a/SpringMVCHandlers/src/main/webapp/WEB-INF/Greeting.jsp b/SpringMVCHandlers/src/main/webapp/WEB-INF/Greeting.jsp deleted file mode 100644 index 820d2f380f..0000000000 --- a/SpringMVCHandlers/src/main/webapp/WEB-INF/Greeting.jsp +++ /dev/null @@ -1,5 +0,0 @@ - - -

Hello ${message}

- - \ No newline at end of file From a98d3a50e02536c3289e974540fe112297cf518e Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 02:31:45 +0800 Subject: [PATCH 12/33] Delete web.xml --- .../src/main/webapp/WEB-INF/web.xml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 SpringMVCHandlers/src/main/webapp/WEB-INF/web.xml diff --git a/SpringMVCHandlers/src/main/webapp/WEB-INF/web.xml b/SpringMVCHandlers/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index d47deec14e..0000000000 --- a/SpringMVCHandlers/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - spring - org.springframework.web.servlet.DispatcherServlet - - contextConfigLocation - classpath*:spring-servlet.xml - - 1 - - - spring - / - - \ No newline at end of file From 37de74f1c9837780f03da489bc46a3a99a71fee0 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 02:31:54 +0800 Subject: [PATCH 13/33] Delete spring-servlet.xml --- .../src/main/resources/spring-servlet.xml | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 SpringMVCHandlers/src/main/resources/spring-servlet.xml diff --git a/SpringMVCHandlers/src/main/resources/spring-servlet.xml b/SpringMVCHandlers/src/main/resources/spring-servlet.xml deleted file mode 100644 index eb42f89847..0000000000 --- a/SpringMVCHandlers/src/main/resources/spring-servlet.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 408af40b48cc4cb6efd088cc8d83046c79440455 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 02:32:03 +0800 Subject: [PATCH 14/33] Delete AnnotationMethodHandlerAdapterExampleController.java --- ...onMethodHandlerAdapterExampleController.java | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java diff --git a/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java b/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java deleted file mode 100644 index 9837467e19..0000000000 --- a/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.baeldung.spring.controller; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -@Controller -public class AnnotationMethodHandlerAdapterExampleController { - @RequestMapping("/annotedName") - public ModelAndView getEmployeeName() { - ModelAndView model = new ModelAndView("Greeting"); - - model.addObject("message", "Dinesh"); - - return model; - } -} From aabc39ccfa33fc992e78745d02f72dbc8dfe3a9e Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 02:32:10 +0800 Subject: [PATCH 15/33] Delete RequestMappingHandlerAdapterExampleController.java --- ...tMappingHandlerAdapterExampleController.java | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java diff --git a/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java b/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java deleted file mode 100644 index 012ba555dc..0000000000 --- a/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.baeldung.spring.controller; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -@Controller -public class RequestMappingHandlerAdapterExampleController { - @RequestMapping("/requestName") - public ModelAndView getEmployeeName() { - ModelAndView model = new ModelAndView("Greeting"); - - model.addObject("message", "Madhwal"); - - return model; - } -} From beae894d98d11a3853e84f851458e2b4698bd416 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 02:32:17 +0800 Subject: [PATCH 16/33] Delete SimpleControllerHandlerAdapterExampleController.java --- ...rollerHandlerAdapterExampleController.java | 21 ------------------- 1 file changed, 21 deletions(-) delete mode 100644 SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java diff --git a/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java b/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java deleted file mode 100644 index 59d932812c..0000000000 --- a/SpringMVCHandlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.baeldung.spring.controller; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.mvc.AbstractController; - -public class SimpleControllerHandlerAdapterExampleController extends -AbstractController { - -@Override -protected ModelAndView handleRequestInternal(HttpServletRequest arg0, - HttpServletResponse arg1) throws Exception { -ModelAndView model = new ModelAndView("Greeting"); - -model.addObject("message", "Dinesh Madhwal"); - -return model; -} -} \ No newline at end of file From c884ab0f30ec8a0e0fe67f9c52d400aa934d4a7d Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 13:59:00 +0800 Subject: [PATCH 17/33] Delete .classpath --- spring-mvc-handlers/.classpath | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 spring-mvc-handlers/.classpath diff --git a/spring-mvc-handlers/.classpath b/spring-mvc-handlers/.classpath deleted file mode 100644 index c4978de982..0000000000 --- a/spring-mvc-handlers/.classpath +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - From 991b9629a049ad53b95601832f902e011338cdef Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 15:02:41 +0800 Subject: [PATCH 18/33] Formatted the code --- ...ationMethodHandlerAdapterExampleController.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java index 9837467e19..ac38155d8c 100644 --- a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java +++ b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java @@ -6,12 +6,10 @@ import org.springframework.web.servlet.ModelAndView; @Controller public class AnnotationMethodHandlerAdapterExampleController { - @RequestMapping("/annotedName") - public ModelAndView getEmployeeName() { - ModelAndView model = new ModelAndView("Greeting"); - - model.addObject("message", "Dinesh"); - - return model; - } + @RequestMapping("/annotedName") + public ModelAndView getEmployeeName() { + ModelAndView model = new ModelAndView("Greeting"); + model.addObject("message", "Dinesh"); + return model; + } } From 7d335e369498865de5f1ea723b2e1e263e754367 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 15:04:34 +0800 Subject: [PATCH 19/33] Delete .project --- spring-mvc-handlers/.project | 42 ------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 spring-mvc-handlers/.project diff --git a/spring-mvc-handlers/.project b/spring-mvc-handlers/.project deleted file mode 100644 index 25a99f0f7f..0000000000 --- a/spring-mvc-handlers/.project +++ /dev/null @@ -1,42 +0,0 @@ - - - SpringMVCHandlers - - - - - - org.eclipse.wst.jsdt.core.javascriptValidator - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.wst.validation.validationbuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jem.workbench.JavaEMFNature - org.eclipse.wst.common.modulecore.ModuleCoreNature - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - org.eclipse.wst.common.project.facet.core.nature - org.eclipse.wst.jsdt.core.jsNature - - From 7868a1ec845818b19429a7b69d1bd381ecabc673 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 15:04:54 +0800 Subject: [PATCH 20/33] Formatted the code --- ...MappingHandlerAdapterExampleController.java | 14 ++++++-------- ...trollerHandlerAdapterExampleController.java | 18 ++++++++---------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java index 012ba555dc..06c94a7746 100644 --- a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java +++ b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java @@ -6,12 +6,10 @@ import org.springframework.web.servlet.ModelAndView; @Controller public class RequestMappingHandlerAdapterExampleController { - @RequestMapping("/requestName") - public ModelAndView getEmployeeName() { - ModelAndView model = new ModelAndView("Greeting"); - - model.addObject("message", "Madhwal"); - - return model; - } + @RequestMapping("/requestName") + public ModelAndView getEmployeeName() { + ModelAndView model = new ModelAndView("Greeting"); + model.addObject("message", "Madhwal"); + return model; + } } diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java index 59d932812c..6e6e29e3d6 100644 --- a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java +++ b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java @@ -7,15 +7,13 @@ import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.AbstractController; public class SimpleControllerHandlerAdapterExampleController extends -AbstractController { + AbstractController { -@Override -protected ModelAndView handleRequestInternal(HttpServletRequest arg0, - HttpServletResponse arg1) throws Exception { -ModelAndView model = new ModelAndView("Greeting"); - -model.addObject("message", "Dinesh Madhwal"); - -return model; -} + @Override + protected ModelAndView handleRequestInternal(HttpServletRequest arg0, + HttpServletResponse arg1) throws Exception { + ModelAndView model = new ModelAndView("Greeting"); + model.addObject("message", "Dinesh Madhwal"); + return model; + } } \ No newline at end of file From 3c8cf035eceb59b4dcb995b5738f461b0ba34231 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 29 Nov 2016 15:07:16 +0800 Subject: [PATCH 21/33] Formatted the code --- .../RequestMappingHandlerAdapterExampleController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java index 06c94a7746..aab04516d9 100644 --- a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java +++ b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java @@ -9,7 +9,7 @@ public class RequestMappingHandlerAdapterExampleController { @RequestMapping("/requestName") public ModelAndView getEmployeeName() { ModelAndView model = new ModelAndView("Greeting"); - model.addObject("message", "Madhwal"); + model.addObject("message","Madhwal"); return model; } } From 1ba3014a4a4b8da8fb4e06739f0aabcbd8e86c69 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Thu, 1 Dec 2016 23:46:57 +0800 Subject: [PATCH 22/33] Removed commented configs --- ...servlet_AnnotationMethodHandlerAdapter.xml | 23 +++++++++++++++++++ ...g-servlet_RequestMappingHandlerAdapter.xml | 23 +++++++++++++++++++ ...servlet_SimpleControllerHandlerAdapter.xml | 21 +++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 spring-mvc-handlers/src/main/resources/spring-servlet_AnnotationMethodHandlerAdapter.xml create mode 100644 spring-mvc-handlers/src/main/resources/spring-servlet_RequestMappingHandlerAdapter.xml create mode 100644 spring-mvc-handlers/src/main/resources/spring-servlet_SimpleControllerHandlerAdapter.xml diff --git a/spring-mvc-handlers/src/main/resources/spring-servlet_AnnotationMethodHandlerAdapter.xml b/spring-mvc-handlers/src/main/resources/spring-servlet_AnnotationMethodHandlerAdapter.xml new file mode 100644 index 0000000000..f7f28db9fa --- /dev/null +++ b/spring-mvc-handlers/src/main/resources/spring-servlet_AnnotationMethodHandlerAdapter.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-mvc-handlers/src/main/resources/spring-servlet_RequestMappingHandlerAdapter.xml b/spring-mvc-handlers/src/main/resources/spring-servlet_RequestMappingHandlerAdapter.xml new file mode 100644 index 0000000000..d19188e882 --- /dev/null +++ b/spring-mvc-handlers/src/main/resources/spring-servlet_RequestMappingHandlerAdapter.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-mvc-handlers/src/main/resources/spring-servlet_SimpleControllerHandlerAdapter.xml b/spring-mvc-handlers/src/main/resources/spring-servlet_SimpleControllerHandlerAdapter.xml new file mode 100644 index 0000000000..d8d2e6809c --- /dev/null +++ b/spring-mvc-handlers/src/main/resources/spring-servlet_SimpleControllerHandlerAdapter.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + \ No newline at end of file From 7f9194c77c5e66b5d492d9b520d69d518624f1df Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Thu, 1 Dec 2016 23:48:14 +0800 Subject: [PATCH 23/33] Changed the config file name --- spring-mvc-handlers/src/main/webapp/WEB-INF/web.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-mvc-handlers/src/main/webapp/WEB-INF/web.xml b/spring-mvc-handlers/src/main/webapp/WEB-INF/web.xml index d47deec14e..b6f1065cad 100644 --- a/spring-mvc-handlers/src/main/webapp/WEB-INF/web.xml +++ b/spring-mvc-handlers/src/main/webapp/WEB-INF/web.xml @@ -8,7 +8,7 @@ org.springframework.web.servlet.DispatcherServlet contextConfigLocation - classpath*:spring-servlet.xml + classpath*:spring-servlet_RequestMappingHandlerAdapter.xml 1 From fc19dfa99741877cfc02f166822f9bd968c74a81 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Thu, 1 Dec 2016 23:49:56 +0800 Subject: [PATCH 24/33] Delete spring-servlet.xml --- .../src/main/resources/spring-servlet.xml | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 spring-mvc-handlers/src/main/resources/spring-servlet.xml diff --git a/spring-mvc-handlers/src/main/resources/spring-servlet.xml b/spring-mvc-handlers/src/main/resources/spring-servlet.xml deleted file mode 100644 index eb42f89847..0000000000 --- a/spring-mvc-handlers/src/main/resources/spring-servlet.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From e21efe8c080779a393ccb0c7dea69ff194964f60 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 6 Dec 2016 02:06:25 +0800 Subject: [PATCH 25/33] Changed the controller class name. --- .../AnnotationMethodHandlerAdapterExample.java | 15 +++++++++++++++ .../RequestMappingHandlerAdapterExample.java | 15 +++++++++++++++ .../SimpleControllerHandlerAdapterExample.java | 18 ++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExample.java create mode 100644 spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExample.java create mode 100644 spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExample.java diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExample.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExample.java new file mode 100644 index 0000000000..ac38155d8c --- /dev/null +++ b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExample.java @@ -0,0 +1,15 @@ +package com.baeldung.spring.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; + +@Controller +public class AnnotationMethodHandlerAdapterExampleController { + @RequestMapping("/annotedName") + public ModelAndView getEmployeeName() { + ModelAndView model = new ModelAndView("Greeting"); + model.addObject("message", "Dinesh"); + return model; + } +} diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExample.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExample.java new file mode 100644 index 0000000000..aab04516d9 --- /dev/null +++ b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExample.java @@ -0,0 +1,15 @@ +package com.baeldung.spring.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; + +@Controller +public class RequestMappingHandlerAdapterExampleController { + @RequestMapping("/requestName") + public ModelAndView getEmployeeName() { + ModelAndView model = new ModelAndView("Greeting"); + model.addObject("message","Madhwal"); + return model; + } +} diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExample.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExample.java new file mode 100644 index 0000000000..699021333a --- /dev/null +++ b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExample.java @@ -0,0 +1,18 @@ +package com.baeldung.spring.controller; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.mvc.AbstractController; + +public class SimpleControllerHandlerAdapterExampleController extends + AbstractController { + @Override + protected ModelAndView handleRequestInternal(HttpServletRequest arg0, + HttpServletResponse arg1) throws Exception { + ModelAndView model = new ModelAndView("Greeting"); + model.addObject("message", "Dinesh Madhwal"); + return model; + } +} \ No newline at end of file From ab7925d330e904567239daf25275f86a5a0e1045 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 6 Dec 2016 02:16:06 +0800 Subject: [PATCH 26/33] Delete AnnotationMethodHandlerAdapterExampleController.java --- ...tionMethodHandlerAdapterExampleController.java | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java deleted file mode 100644 index ac38155d8c..0000000000 --- a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.spring.controller; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -@Controller -public class AnnotationMethodHandlerAdapterExampleController { - @RequestMapping("/annotedName") - public ModelAndView getEmployeeName() { - ModelAndView model = new ModelAndView("Greeting"); - model.addObject("message", "Dinesh"); - return model; - } -} From cf58289d6d7c288dbc600b2253d8dcf91df7ccac Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 6 Dec 2016 02:16:12 +0800 Subject: [PATCH 27/33] Delete RequestMappingHandlerAdapterExampleController.java --- ...estMappingHandlerAdapterExampleController.java | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java deleted file mode 100644 index aab04516d9..0000000000 --- a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.spring.controller; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -@Controller -public class RequestMappingHandlerAdapterExampleController { - @RequestMapping("/requestName") - public ModelAndView getEmployeeName() { - ModelAndView model = new ModelAndView("Greeting"); - model.addObject("message","Madhwal"); - return model; - } -} From b4893e7550cafa8f1f994bcf3553be16fabfdd3f Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 6 Dec 2016 02:16:19 +0800 Subject: [PATCH 28/33] Delete SimpleControllerHandlerAdapterExampleController.java --- ...rollerHandlerAdapterExampleController.java | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java deleted file mode 100644 index 6e6e29e3d6..0000000000 --- a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.spring.controller; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.mvc.AbstractController; - -public class SimpleControllerHandlerAdapterExampleController extends - AbstractController { - - @Override - protected ModelAndView handleRequestInternal(HttpServletRequest arg0, - HttpServletResponse arg1) throws Exception { - ModelAndView model = new ModelAndView("Greeting"); - model.addObject("message", "Dinesh Madhwal"); - return model; - } -} \ No newline at end of file From caef50355d576688f4570a8b9da8fdfb47dc8394 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 6 Dec 2016 02:19:23 +0800 Subject: [PATCH 29/33] Changed the class name --- .../controller/AnnotationMethodHandlerAdapterExample.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExample.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExample.java index ac38155d8c..164830cd6a 100644 --- a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExample.java +++ b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExample.java @@ -5,11 +5,11 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; @Controller -public class AnnotationMethodHandlerAdapterExampleController { +public class AnnotationMethodHandlerAdapterExample { @RequestMapping("/annotedName") public ModelAndView getEmployeeName() { ModelAndView model = new ModelAndView("Greeting"); model.addObject("message", "Dinesh"); return model; } -} +} \ No newline at end of file From 9e7af2365206ab52f49ad0523f3763790ea43878 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 6 Dec 2016 02:23:55 +0800 Subject: [PATCH 30/33] Deleted the files --- ...MethodHandlerAdapterExampleController.java | 15 --------------- ...appingHandlerAdapterExampleController.java | 15 --------------- ...rollerHandlerAdapterExampleController.java | 19 ------------------- 3 files changed, 49 deletions(-) delete mode 100644 spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java delete mode 100644 spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java delete mode 100644 spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java deleted file mode 100644 index ac38155d8c..0000000000 --- a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/AnnotationMethodHandlerAdapterExampleController.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.spring.controller; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -@Controller -public class AnnotationMethodHandlerAdapterExampleController { - @RequestMapping("/annotedName") - public ModelAndView getEmployeeName() { - ModelAndView model = new ModelAndView("Greeting"); - model.addObject("message", "Dinesh"); - return model; - } -} diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java deleted file mode 100644 index aab04516d9..0000000000 --- a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExampleController.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.spring.controller; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -@Controller -public class RequestMappingHandlerAdapterExampleController { - @RequestMapping("/requestName") - public ModelAndView getEmployeeName() { - ModelAndView model = new ModelAndView("Greeting"); - model.addObject("message","Madhwal"); - return model; - } -} diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java deleted file mode 100644 index 6e6e29e3d6..0000000000 --- a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExampleController.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.spring.controller; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.mvc.AbstractController; - -public class SimpleControllerHandlerAdapterExampleController extends - AbstractController { - - @Override - protected ModelAndView handleRequestInternal(HttpServletRequest arg0, - HttpServletResponse arg1) throws Exception { - ModelAndView model = new ModelAndView("Greeting"); - model.addObject("message", "Dinesh Madhwal"); - return model; - } -} \ No newline at end of file From 130b2f802f9965bc8950a3f04e4166e5c505706b Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 6 Dec 2016 02:24:33 +0800 Subject: [PATCH 31/33] Changed File name --- .../controller/SimpleControllerHandlerAdapterExample.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExample.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExample.java index 699021333a..48ece758a9 100644 --- a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExample.java +++ b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/SimpleControllerHandlerAdapterExample.java @@ -6,7 +6,7 @@ import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.AbstractController; -public class SimpleControllerHandlerAdapterExampleController extends +public class SimpleControllerHandlerAdapterExample extends AbstractController { @Override protected ModelAndView handleRequestInternal(HttpServletRequest arg0, From fbae4042c629fbd7bbe5025ac45536d0189bb139 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 6 Dec 2016 02:37:17 +0800 Subject: [PATCH 32/33] Changed File name --- .../controller/RequestMappingHandlerAdapterExample.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExample.java b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExample.java index aab04516d9..76ac3e2806 100644 --- a/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExample.java +++ b/spring-mvc-handlers/src/main/java/com/baeldung/spring/controller/RequestMappingHandlerAdapterExample.java @@ -5,11 +5,11 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; @Controller -public class RequestMappingHandlerAdapterExampleController { +public class RequestMappingHandlerAdapterExample { @RequestMapping("/requestName") public ModelAndView getEmployeeName() { ModelAndView model = new ModelAndView("Greeting"); - model.addObject("message","Madhwal"); + model.addObject("message", "Madhwal"); return model; } -} +} \ No newline at end of file From c98bba7043c1bed576a7c1ace99acb11a5afa170 Mon Sep 17 00:00:00 2001 From: dineshmadhwal Date: Tue, 6 Dec 2016 02:38:11 +0800 Subject: [PATCH 33/33] Code Formatting --- ...servlet_AnnotationMethodHandlerAdapter.xml | 33 +++++++++-------- ...g-servlet_RequestMappingHandlerAdapter.xml | 35 +++++++++++-------- ...servlet_SimpleControllerHandlerAdapter.xml | 32 +++++++++-------- 3 files changed, 56 insertions(+), 44 deletions(-) diff --git a/spring-mvc-handlers/src/main/resources/spring-servlet_AnnotationMethodHandlerAdapter.xml b/spring-mvc-handlers/src/main/resources/spring-servlet_AnnotationMethodHandlerAdapter.xml index f7f28db9fa..a8071a622f 100644 --- a/spring-mvc-handlers/src/main/resources/spring-servlet_AnnotationMethodHandlerAdapter.xml +++ b/spring-mvc-handlers/src/main/resources/spring-servlet_AnnotationMethodHandlerAdapter.xml @@ -1,23 +1,26 @@ - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:mvc="http://www.springframework.org/schema/mvc" + xmlns:tx="http://www.springframework.org/schema/tx" + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation= + "http://www.springframework.org/schema/mvc + http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd + http://www.springframework.org/schema/tx + http://www.springframework.org/schema/tx/spring-tx-3.1.xsd + http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans-3.1.xsd + http://www.springframework.org/schema/context + http://www.springframework.org/schema/context/spring-context-3.1.xsd"> - - + class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/> - + class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/> - - + class="org.springframework.web.servlet.view.InternalResourceViewResolver"> + + \ No newline at end of file diff --git a/spring-mvc-handlers/src/main/resources/spring-servlet_RequestMappingHandlerAdapter.xml b/spring-mvc-handlers/src/main/resources/spring-servlet_RequestMappingHandlerAdapter.xml index d19188e882..b32a213eb3 100644 --- a/spring-mvc-handlers/src/main/resources/spring-servlet_RequestMappingHandlerAdapter.xml +++ b/spring-mvc-handlers/src/main/resources/spring-servlet_RequestMappingHandlerAdapter.xml @@ -1,23 +1,28 @@ - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:mvc="http://www.springframework.org/schema/mvc" + xmlns:tx="http://www.springframework.org/schema/tx" + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation= + "http://www.springframework.org/schema/mvc + http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd + http://www.springframework.org/schema/tx + http://www.springframework.org/schema/tx/spring-tx-3.1.xsd + http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans-3.1.xsd + http://www.springframework.org/schema/context + http://www.springframework.org/schema/context/spring-context-3.1.xsd"> - - + class= + "org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"/> - + class= + "org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"/> - - + class="org.springframework.web.servlet.view.InternalResourceViewResolver"> + + \ No newline at end of file diff --git a/spring-mvc-handlers/src/main/resources/spring-servlet_SimpleControllerHandlerAdapter.xml b/spring-mvc-handlers/src/main/resources/spring-servlet_SimpleControllerHandlerAdapter.xml index d8d2e6809c..60c9b9e3df 100644 --- a/spring-mvc-handlers/src/main/resources/spring-servlet_SimpleControllerHandlerAdapter.xml +++ b/spring-mvc-handlers/src/main/resources/spring-servlet_SimpleControllerHandlerAdapter.xml @@ -1,21 +1,25 @@ - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:mvc="http://www.springframework.org/schema/mvc" + xmlns:tx="http://www.springframework.org/schema/tx" + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation= + "http://www.springframework.org/schema/mvc + http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd + http://www.springframework.org/schema/tx + http://www.springframework.org/schema/tx/spring-tx-3.1.xsd + http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans-3.1.xsd + http://www.springframework.org/schema/context + http://www.springframework.org/schema/context/spring-context-3.1.xsd"> - + class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/> - + class="com.baeldung.spring.controller.SimpleControllerHandlerAdapterExample"/> - - + class="org.springframework.web.servlet.view.InternalResourceViewResolver"> + + \ No newline at end of file