Spring Static Pages Example

<div dir&equals;"ltr" style&equals;"text-align&colon; justify&semi;" trbidi&equals;"on">&NewLine;<div dir&equals;"ltr" style&equals;"text-align&colon; justify&semi;" trbidi&equals;"on">In this example show how to write a simple web based application using <b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-web-mvc-framework-chapter-38&sol;">Spring MVC Framework<&sol;a><&sol;b>&comma; which can access static pages along with dynamic pages with the help of <b>&lt&semi;mvc&colon;resources&gt&semi;<&sol;b> tag&period; To start with it&comma; let us have working STS IDE in place and follow the following steps to develop a Dynamic Form based Web Application using Spring Web Framework&colon;<&sol;p>&NewLine;<div style&equals;"background-color&colon; &num;f2f9fc&semi; border&colon;1px solid &num;c9e6f2&semi;border-radius&colon;3px&semi;padding&colon;16px&semi;line-height&colon;1&period;45&semi;">&NewLine;<span style&equals;"color&colon; red&semi;font-size&colon; x-large&semi;text-align&colon; center&semi;"><b>Popular Tutorials<&sol;b><&sol;span><&sol;p>&NewLine;<ul style&equals;"text-align&colon; left&semi;">&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-tutorial&sol;"><em><strong>Spring Tutorial<&sol;strong> <&sol;em><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-web-mvc-framework-chapter-38&sol;"><strong><em>Spring MVC Web Tutorial <&sol;em><&sol;strong><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;introduction-to-spring-boot-a-spring-boot-complete-guide&sol;"><strong>Spring Boot Tutorial<&sol;strong> <&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-security-take-baby-step-to-secure&sol;"><em>Spring Security Tutorial<&sol;em><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-aop-tutorial-with-example-aspect-advice-pointcut-joinpoint&sol;"><em>Spring AOP Tutorial<&sol;em><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;using-spring-jdbc-framework-chapter-32&sol;"><em>Spring JDBC Tutorial<&sol;em><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-hateoas-hypermedia-driven-restful-web-service&sol;"><em><strong>Spring HATEOAS <&sol;strong><&sol;em><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;microservices-with-spring-boot&sol;"><em><strong>Microservices with Spring Boot<&sol;strong><&sol;em><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;jax-rs-web-service-tutorial&sol;"><strong><em>REST Webservice<&sol;em> <&sol;strong><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;core-java-baby-step-to-be-best-java-ian&sol;"><em><strong>Core Java <&sol;strong><&sol;em><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;hibernate-3-on-baby-steps&sol;"><em><strong>Hibernate Tutorial<&sol;strong><&sol;em><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-batch-process-with-example&sol;"><strong><em>Spring Batch<&sol;em> <&sol;strong><&sol;a><&sol;b><&sol;li>&NewLine;<&sol;ul>&NewLine;<&sol;div>&NewLine;<p><b><b>Step 1&colon;<&sol;b> Create a <b><i>Dynamic Web Project<&sol;i><&sol;b> with a name <b><i>SpringMVCStaticApp<&sol;i><&sol;b> and create a package <i><b>com<&sol;b>&period;<b>dineshonjava&period;controller<&sol;b><&sol;i> under the <b><i>src<&sol;i> <&sol;b>folder in the created project&period;<&sol;p>&NewLine;<p><b>Step 2&colon; <&sol;b>Add below mentioned <b>Spring 3&period;0 libraries<&sol;b> and other libraries into the folder <b><i>WebRoot&sol;WEB-INF&sol;lib<&sol;i><&sol;b>&period;&nbsp&semi;<br &sol;>&NewLine;<&sol;b><&sol;p>&NewLine;<ul class&equals;"list">&NewLine;<li>commons-logging-1&period;1&period;1&period;jar<&sol;li>&NewLine;<li>org&period;springframework&period;asm-3&period;0&period;0&period;jar<&sol;li>&NewLine;<li>org&period;springframework&period;beans-3&period;0&period;0&period;jar<&sol;li>&NewLine;<li>org&period;springframework&period;context-3&period;0&period;0&period;jar<&sol;li>&NewLine;<li>org&period;springframework&period;core-3&period;0&period;0&period;jar<&sol;li>&NewLine;<li>org&period;springframework&period;expression-3&period;0&period;0&period;jar<&sol;li>&NewLine;<li>org&period;springframework&period;web&period;servlet-3&period;0&period;0&period;jar<&sol;li>&NewLine;<li>org&period;springframework&period;web-3&period;0&period;0&period;jar<&sol;li>&NewLine;<li>spring-web&period;3&period;0&period;0&period;jar<&sol;li>&NewLine;<&sol;ul>&NewLine;<p>&nbsp&semi;<b>Step 3&colon; <&sol;b>Create a Java class <b><i>WebStaticController<&sol;i> <&sol;b>under the <i><b>com<&sol;b>&period;<b>dineshonjava&period;controller<&sol;b><&sol;i> package&period;<&sol;p>&NewLine;<p><b>Step 4&colon;<&sol;b> Create Spring configuration files <b><i>Web&period;xml<&sol;i><&sol;b> and <b><i>sdnext-servlet&period;xml<&sol;i><&sol;b> under the <b><i>WebRoot&sol;WEB-INF&sol; <&sol;i><&sol;b>folder&period;<&sol;p>&NewLine;<p><b>Step 5&colon;<&sol;b> Create a sub-folder with a name <i><b>views <&sol;b><&sol;i>under the <i><b>WebRoot&sol;WEB-INF <&sol;b><&sol;i>folder&period; Create a view file <b><i>welcome&period;jsp<&sol;i><&sol;b> under this sub-folder and <i><b>static&period;html <&sol;b><&sol;i>under <i><b>staticContents <&sol;b><&sol;i>sub-folder&period;<&sol;p>&NewLine;<p><b>Step <i>6<&sol;i>&colon;<&sol;b> The final step is to create the content of all the source and configuration files name <i><b>sdnext-servlet&period;xml<&sol;b><&sol;i> under the sub-folder <i><b>WebRoot&sol;WEB-INF&sol;config <&sol;b><&sol;i>and export the application as explained below&period;<b>&nbsp&semi;<&sol;b><b>&nbsp&semi;<&sol;b><&sol;p>&NewLine;<p><b>Software versions used to run the sample code&colon;<&sol;b><&sol;p>&NewLine;<ul>&NewLine;<li>Spring 3&period;0<&sol;li>&NewLine;<li>Java 1&period;6<&sol;li>&NewLine;<li>Tomcat 7<&sol;li>&NewLine;<li>JSTL 1&period;2<&sol;li>&NewLine;<li><b>STS<&sol;b> Java EE IDE<&sol;li>&NewLine;<&sol;ul>&NewLine;<div style&equals;"text-align&colon; left&semi;">&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi;&nbsp&semi; <b>Web Application Structure&colon;<&sol;b><&sol;p>&NewLine;<div class&equals;"separator" style&equals;"clear&colon; both&semi; text-align&colon; center&semi;"><img border&equals;"0" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2012&sol;12&sol;staticMVC&period;jpg"&sol;><&sol;div>&NewLine;<p><b>WebStaticController&period;java <&sol;b><&sol;div>&NewLine;<pre class&equals;"highlight" name&equals;"code">package com&period;dineshonjava&period;controller&semi; &NewLine; &NewLine;import org&period;springframework&period;stereotype&period;Controller&semi; &NewLine;import org&period;springframework&period;web&period;bind&period;annotation&period;RequestMapping&semi; &NewLine;import org&period;springframework&period;web&period;bind&period;annotation&period;RequestMethod&semi; &NewLine; &NewLine;&sol;&ast;&ast; &NewLine; &ast; &commat;author Dinesh Rajput &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;&commat;Controller &NewLine;public class WebStaticController &lbrace; &NewLine; &NewLine; &commat;RequestMapping&lpar;value &equals; "&sol;welcome"&comma; method &equals; RequestMethod&period;GET&rpar; &NewLine; public String welcome&lpar;&rpar; &lbrace; &NewLine; return "welcome"&semi; &NewLine; &rcub; &NewLine; &NewLine; &commat;RequestMapping&lpar;value &equals; "&sol;staticPage"&comma; method &equals; RequestMethod&period;GET&rpar; &NewLine; public String redirect&lpar;&rpar; &lbrace; &NewLine; return "redirect&colon;&sol;staticContents&sol;static&period;html"&semi; &NewLine; &rcub; &NewLine;&rcub; &NewLine;<&sol;pre>&NewLine;<p><b>Spring Web configuration file <i>web&period;xml<&sol;i><&sol;b><&sol;p>&NewLine;<pre class&equals;"highlight" name&equals;"code">&lt&semi;web-app id&equals;"WebApp&lowbar;ID" version&equals;"3&period;0" xmlns&colon;web&equals;"http&colon;&sol;&sol;java&period;sun&period;com&sol;xml&sol;ns&sol;javaee&sol;web-app&lowbar;2&lowbar;5&period;xsd" xmlns&colon;xsi&equals;"http&colon;&sol;&sol;www&period;w3&period;org&sol;2001&sol;XMLSchema-instance" xmlns&equals;"http&colon;&sol;&sol;java&period;sun&period;com&sol;xml&sol;ns&sol;javaee" xsi&colon;schemalocation&equals;"http&colon;&sol;&sol;java&period;sun&period;com&sol;xml&sol;ns&sol;javaee http&colon;&sol;&sol;java&period;sun&period;com&sol;xml&sol;ns&sol;javaee&sol;web-app&lowbar;3&lowbar;0&period;xsd"&gt&semi; &NewLine; &NewLine; &lt&semi;display-name&gt&semi;SpringMVCStaticApp&lt&semi;&sol;display-name&gt&semi; &NewLine; &lt&semi;welcome-file-list&gt&semi; &NewLine; &lt&semi;welcome-file&gt&semi;&sol;&lt&semi;&sol;welcome-file&gt&semi; &NewLine; &lt&semi;&sol;welcome-file-list&gt&semi; &NewLine; &NewLine; &lt&semi;servlet&gt&semi; &NewLine; &lt&semi;servlet-name&gt&semi;sdnext&lt&semi;&sol;servlet-name&gt&semi; &NewLine; &lt&semi;servlet-class&gt&semi; &NewLine; org&period;springframework&period;web&period;servlet&period;DispatcherServlet &NewLine; &lt&semi;&sol;servlet-class&gt&semi; &NewLine; &lt&semi;init-param&gt&semi; &NewLine; &lt&semi;param-name&gt&semi;contextConfigLocation&lt&semi;&sol;param-name&gt&semi;&lt&semi;param-value&gt&semi;&sol;WEB-INF&sol;config&sol;sdnext-servlet&period;xml&lt&semi;&sol;param-value&gt&semi;&lt&semi;&sol;init-param&gt&semi; &NewLine; &lt&semi;load-on-startup&gt&semi;1&lt&semi;&sol;load-on-startup&gt&semi; &NewLine; &lt&semi;&sol;servlet&gt&semi; &NewLine; &lt&semi;servlet-mapping&gt&semi; &NewLine; &lt&semi;servlet-name&gt&semi;sdnext&lt&semi;&sol;servlet-name&gt&semi; &NewLine; &lt&semi;url-pattern&gt&semi;&sol;&lt&semi;&sol;url-pattern&gt&semi; &NewLine; &lt&semi;&sol;servlet-mapping&gt&semi; &NewLine;&lt&semi;&sol;web-app&gt&semi; &NewLine;<&sol;pre>&NewLine;<p><b>another Spring Web configuration file <i>sdnext-servlet&period;xml<&sol;i><&sol;b><&sol;p>&NewLine;<pre class&equals;"highlight" name&equals;"code">&lt&semi;beans xmlns&colon;context&equals;"http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;context" xmlns&colon;mvc&equals;"http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;mvc" xmlns&colon;p&equals;"http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;p" xmlns&colon;xsi&equals;"http&colon;&sol;&sol;www&period;w3&period;org&sol;2001&sol;XMLSchema-instance" xmlns&equals;"http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;beans" xsi&colon;schemalocation&equals;" &NewLine; http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;beans &NewLine; http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;beans&sol;spring-beans-3&period;0&period;xsd &NewLine; http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;context &NewLine; http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;context&sol;spring-context-3&period;0&period;xsd &NewLine; http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;mvc &NewLine; http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;mvc&sol;spring-mvc-3&period;0&period;xsd"&gt&semi; &NewLine; &NewLine; &lt&semi;&excl;-- Enable annotation driven controllers&comma; validation etc&period;&period;&period; --&gt&semi; &NewLine;&lt&semi;mvc&colon;annotation-driven&gt&semi;&lt&semi;&sol;mvc&colon;annotation-driven&gt&semi; &NewLine; &NewLine;&lt&semi;context&colon;component-scan base-package&equals;"com&period;dineshonjava&period;controller"&gt&semi; &NewLine;&lt&semi;&sol;context&colon;component-scan&gt&semi; &NewLine; &NewLine;&lt&semi;bean class&equals;"org&period;springframework&period;web&period;servlet&period;view&period;InternalResourceViewResolver" id&equals;"viewResolver"&gt&semi; &NewLine; &lt&semi;property name&equals;"prefix" value&equals;"&sol;WEB-INF&sol;views&sol;"&gt&semi;&lt&semi;&sol;property&gt&semi; &NewLine; &lt&semi;property name&equals;"suffix" value&equals;"&period;jsp"&gt&semi;&lt&semi;&sol;property&gt&semi; &NewLine;&lt&semi;&sol;bean&gt&semi; &NewLine; &NewLine;&lt&semi;mvc&colon;resources location&equals;"&sol;WEB-INF&sol;staticContents&sol;" mapping&equals;"&sol;staticContents&sol;&ast;&ast;"&gt&semi; &NewLine;&lt&semi;&sol;mvc&colon;resources&gt&semi; &NewLine;&lt&semi;&sol;beans&gt&semi; &NewLine;<&sol;pre>&NewLine;<p>Following is the content of Spring view file <i><b>welcome&period;jsp&period; <&sol;b><&sol;i>This will be a landing page&comma; this page will send a request to access redirect service method which will redirect this request to another service method and finally a <i><b>static&period;html<&sol;b><&sol;i> page will be displayed&period;<br &sol;>&NewLine;<i><b>welcome&period;jsp<&sol;b><&sol;i><&sol;p>&NewLine;<pre class&equals;"highlight" name&equals;"code">&lt&semi;&percnt;&commat; page language&equals;"java" contentType&equals;"text&sol;html&semi; charset&equals;ISO-8859-1" &NewLine; pageEncoding&equals;"ISO-8859-1"&percnt;&gt&semi; &NewLine; &NewLine;&lt&semi;&percnt;&commat;taglib uri&equals;"http&colon;&sol;&sol;www&period;springframework&period;org&sol;tags&sol;form" prefix&equals;"form"&percnt;&gt&semi; &NewLine;&lt&semi;html&gt&semi; &NewLine;&lt&semi;head&gt&semi; &NewLine; &lt&semi;title&gt&semi;Spring Landing Page&lt&semi;&sol;title&gt&semi; &NewLine;&lt&semi;&sol;head&gt&semi; &NewLine;&lt&semi;body&gt&semi; &NewLine;&lt&semi;h2&gt&semi; &NewLine;Spring Landing Pag&lt&semi;&sol;h2&gt&semi; &NewLine;Click below button to get a simple HTML page &NewLine;&lt&semi;form&colon;form action&equals;"&sol;sdnext&sol;staticPage" method&equals;"GET"&gt&semi;&lt&semi;table&gt&semi;&lt&semi;tbody&gt&semi; &NewLine;&lt&semi;tr&gt&semi; &lt&semi;td&gt&semi;&lt&semi;input type&equals;"submit" value&equals;"Get HTML Page" &sol;&gt&semi; &lt&semi;&sol;td&gt&semi; &lt&semi;&sol;tr&gt&semi; &NewLine;&lt&semi;&sol;tbody&gt&semi;&lt&semi;&sol;table&gt&semi; &NewLine;&lt&semi;&sol;form&colon;form&gt&semi;&lt&semi;&sol;body&gt&semi; &NewLine;&lt&semi;&sol;html&gt&semi; &NewLine;<&sol;pre>&NewLine;<p>Following is the content of Spring view file<i><b> static&period;html&period;<&sol;b><&sol;i> This is the final redirected page&period;<&sol;p>&NewLine;<pre class&equals;"highlight" name&equals;"code">&lt&semi;html&gt&semi; &NewLine; &lt&semi;head&gt&semi; &NewLine; &lt&semi;title&gt&semi;Spring Static Page&lt&semi;&sol;title&gt&semi; &NewLine; &lt&semi;&sol;head&gt&semi; &NewLine; &lt&semi;body&gt&semi; &NewLine; &NewLine; <h2>A simple HTML page<&sol;h2>&lt&semi;&sol;body&gt&semi; &NewLine;&lt&semi;&sol;html&gt&semi; &NewLine;<&sol;pre>&NewLine;<p>Once you are done with creating source and configuration files&comma; export your application&period; Right click on your application and use <b>Export &gt&semi; WAR <&sol;b>File option and save your <i><b>SpringMVCStaticApp&period;war<&sol;b><&sol;i> file in Tomcat&&num;8217&semi;s <b>web apps<&sol;b> folder&period;<&sol;p>&NewLine;<p> Now start your Tomcat server and make sure you are able to access other web pages from web apps folder using a standard browser&period; Now try a URL<i><b> http&colon;&sol;&sol;localhost&colon;8080&sol;sdnext&sol;welcome<&sol;b><&sol;i> and you should see the following result if everything is fine with your Spring Web Application&colon;<&sol;p>&NewLine;<div class&equals;"separator" style&equals;"clear&colon; both&semi; text-align&colon; center&semi;"><img border&equals;"0" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2012&sol;12&sol;staticMVCOutput&period;jpg"&sol;><&sol;div>&NewLine;<p>&NewLine;Now click on<b> &&num;8220&semi;Get HTML Page&&num;8221&semi;<&sol;b> button to submit the form and to get final redirected static page&period; You should see the following result if everything is fine with your Spring Web Application&colon;<&sol;p>&NewLine;<div class&equals;"separator" style&equals;"clear&colon; both&semi; text-align&colon; center&semi;"><img border&equals;"0" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2012&sol;12&sol;staticMVCOutput2&period;png"&sol;><&sol;div>&NewLine;<p><&sol;p>&NewLine;<div style&equals;"background-color&colon; &num;f2f9fc&semi; border&colon;1px solid &num;c9e6f2&semi;border-radius&colon;3px&semi;padding&colon;16px&semi;line-height&colon;1&period;45&semi;">&NewLine;<span style&equals;"color&colon; red&semi;font-size&colon; x-large&semi;text-align&colon; center&semi;"><b>Spring MVC Related Posts<&sol;b><&sol;span><&sol;p>&NewLine;<ol style&equals;"text-align&colon; left&semi;"><span style&equals;"color&colon; &num;274e13&semi;"><&sol;p>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-web-mvc-framework-chapter-38&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC Web Tutorial<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-mvc-interview-questions-and-answers&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC Interview Questions<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;introduction-to-mvc&sol;"><span style&equals;"color&colon; red&semi;">MVC Design Pattern<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;what-is-dispatcherservlet-in-spring-and-its-uses&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC DispatcherServlet <&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;difference-between-applicationcontext-webapplicationcontext-in-spring-mvc&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC WebApplicationContext and Root Application Context<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;stereotype-annotations-in-spring&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC &commat;Controller Annotation<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;requestmapping-annotation-in-spring-mvc&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC &commat;RequestMapping Annotation<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;requestparam-annotation-in-spring-mvc-with-example&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC &commat;RequestParam Annotation<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;difference-between-applicationcontext-webapplicationcontext-in-spring-mvc&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC ContextLoaderListener<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;requestparam-vs-pathvariable-annotations-in-spring-mvc&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC &commat;RequestParam and &commat;PathVariable annotations<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-30-mvc-hello-world-example&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC Hello World Example<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-exception-handling-example&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC Exception Handling Example<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-mvc-with-hibernate-crud-example&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC with Hibernate CRUD Example<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-3-mvc-tiles-plugin-with-example&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC Tiles Plugin with Example<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-3-mvc-and-interceptor-with&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC Interceptor with example<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;integration-spring-mvc3-and-mongodb&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC with MongoDB CRUD Example<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<li><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-3-mvc-internationalization&sol;"><span style&equals;"color&colon; red&semi;">Spring MVC Internationalization &&num;038&semi; Localization with Example<&sol;span><&sol;a><&sol;b><&sol;li>&NewLine;<p><&sol;span><&sol;ol>&NewLine;<&sol;div>&NewLine;<p><&sol;p>&NewLine;<div style&equals;"text-align&colon; center&semi;"><b>&lt&semi;&lt&semi;<&sol;b><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-web-mvc-framework-chapter-38&sol;">Spring Web MVC Framework<&sol;a><&sol;b><b> &vert;<a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-tutorial&sol;">index<&sol;a>&vert; <&sol;b><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-exception-handling-example&sol;" target&equals;"&lowbar;blank">Spring Exception Handling Example<&sol;a><&sol;b><b><b><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;2012&sol;12&sol;spring-static-pages-example&period;html"><&sol;a><&sol;b><&sol;b><b>&gt&semi;&gt&semi;<&sol;b><&sol;div>&NewLine;<p>&NewLine;&nbsp&semi; <&sol;div>&NewLine;<p>&NewLine;<&sol;div>&NewLine;<div class&equals;"wp-post-navigation"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <div class&equals;"wp-post-navigation-pre"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-page-redirection-example&sol;">Previous<&sol;a> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <&sol;div> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <div class&equals;"wp-post-navigation-next"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-exception-handling-example&sol;">Next<&sol;a> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <&sol;div> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;<&sol;div>&NewLine;<script type&equals;"text&sol;javascript">&NewLine;jQuery&lpar;document&rpar;&period;ready&lpar;function&lpar;&dollar;&rpar; &lbrace;&NewLine; &dollar;&period;post&lpar;'https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-admin&sol;admin-ajax&period;php'&comma; &lbrace;action&colon; 'mts&lowbar;view&lowbar;count'&comma; id&colon; '619'&rcub;&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine;<&sol;script>

Dinesh Rajput

Dinesh Rajput is the chief editor of a website Dineshonjava, a technical blog dedicated to the Spring and Java technologies. It has a series of articles related to Java technologies. Dinesh has been a Spring enthusiast since 2008 and is a Pivotal Certified Spring Professional, an author of a book Spring 5 Design Pattern, and a blogger. He has more than 10 years of experience with different aspects of Spring and Java design and development. His core expertise lies in the latest version of Spring Framework, Spring Boot, Spring Security, creating REST APIs, Microservice Architecture, Reactive Pattern, Spring AOP, Design Patterns, Struts, Hibernate, Web Services, Spring Batch, Cassandra, MongoDB, and Web Application Design and Architecture. He is currently working as a technology manager at a leading product and web development company. He worked as a developer and tech lead at the Bennett, Coleman & Co. Ltd and was the first developer in his previous company, Paytm. Dinesh is passionate about the latest Java technologies and loves to write technical blogs related to it. He is a very active member of the Java and Spring community on different forums. When it comes to the Spring Framework and Java, Dinesh tops the list!

Share
Published by
Dinesh Rajput

Recent Posts

Strategy Design PatternsĀ using Lambda

Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…

4 years ago

Decorator Pattern using Lambda

Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…

4 years ago

Delegating pattern using lambda

Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…

4 years ago

Spring Vs Django- Know The Difference Between The Two

Technology has emerged a lot in the last decade, and now we have artificial intelligence;…

4 years ago

TOP 20 MongoDB INTERVIEW QUESTIONS 2022

Managing a database is becoming increasingly complex now due to the vast amount of data…

4 years ago

Scheduler @Scheduled Annotation Spring Boot

Overview In this article, we will explore Spring Scheduler how we could use it by…

4 years ago