{"id":16841,"date":"2013-05-15T10:00:25","date_gmt":"2013-05-15T07:00:25","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=16841"},"modified":"2013-09-04T01:11:13","modified_gmt":"2013-09-03T22:11:13","slug":"spring-mvc-tutorial","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html","title":{"rendered":"Spring MVC Tutorial"},"content":{"rendered":"<h2>1. Overview and Maven<\/h2>\n<p>This is a simple <strong>Spring MVC tutorial<\/strong> showing how to set up a Spring MVC project, both with Java based Configuration as well as with XML Configuration.<\/p>\n<p>The Maven artifacts for Spring MVC project are described in the in detail in the <a title=\"Spring MVC - the Maven dependencies\" href=\"http:\/\/www.baeldung.com\/spring-with-maven#mvc\">Spring MVC dependencies<\/a> article.<\/p>\n<h2>2. The <em>web.xml<\/em><\/h2>\n<p>This is a simple configuration of the <em>web.xml<\/em> for a Spring MVC project:<\/p>\n<pre class=\" brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;web-app xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n   xmlns=\"http:\/\/java.sun.com\/xml\/ns\/javaee\" \r\n   xmlns:web=\"http:\/\/java.sun.com\/xml\/ns\/javaee\/web-app_3_0.xsd\"\r\n   xsi:schemaLocation=\"\r\n      http:\/\/java.sun.com\/xml\/ns\/javaee \r\n      http:\/\/java.sun.com\/xml\/ns\/javaee\/web-app_3_0.xsd\" \r\n   id=\"WebApp_ID\" version=\"3.0\"&gt;\r\n\r\n   &lt;display-name&gt;Spring MVC Java Config App&lt;\/display-name&gt;\r\n\r\n   &lt;servlet&gt;\r\n      &lt;servlet-name&gt;mvc&lt;\/servlet-name&gt;\r\n      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;\/servlet-class&gt;\r\n      &lt;load-on-startup&gt;1&lt;\/load-on-startup&gt;\r\n   &lt;\/servlet&gt;\r\n   &lt;servlet-mapping&gt;\r\n      &lt;servlet-name&gt;mvc&lt;\/servlet-name&gt;\r\n      &lt;url-pattern&gt;\/&lt;\/url-pattern&gt;\r\n   &lt;\/servlet-mapping&gt;\r\n\r\n   &lt;context-param&gt;\r\n      &lt;param-name&gt;contextClass&lt;\/param-name&gt;\r\n      &lt;param-value&gt;\r\n         org.springframework.web.context.support.AnnotationConfigWebApplicationContext\r\n      &lt;\/param-value&gt;\r\n   &lt;\/context-param&gt;\r\n   &lt;context-param&gt;\r\n      &lt;param-name&gt;contextConfigLocation&lt;\/param-name&gt;\r\n      &lt;param-value&gt;org.baeldung.spring.web.config&lt;\/param-value&gt;\r\n   &lt;\/context-param&gt;\r\n   &lt;listener&gt;\r\n      &lt;listener-class&gt;\r\n         org.springframework.web.context.ContextLoaderListener\r\n      &lt;\/listener-class&gt;\r\n   &lt;\/listener&gt;\r\n\r\n&lt;\/web-app&gt;<\/pre>\n<p>We are using <strong>Java based Configuration<\/strong>, so we\u2019re using <em>AnnotationConfigWebApplicationContext<\/em> as the main context class \u2013 this accepts <em>@Configuration<\/em> annotated classes as input. As such, we only need to specify the package where these configuration classes are located, via <em>contextConfigLocation<\/em>.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>To keep this mechanism flexible, multiple packages are also configurable here, simply space delimited:<\/p>\n<pre class=\" brush:xml\">&lt;context-param&gt;\r\n      &lt;param-name&gt;contextConfigLocation&lt;\/param-name&gt;\r\n      &lt;param-value&gt;org.baeldung.spring.web.config org.baeldung.spring.persistence.config&lt;\/param-value&gt;\r\n   &lt;\/context-param&gt;<\/pre>\n<p>This allows more complex projects with multiple modules to manage their own Spring Configuration classes and contribute them to the overall Spring context at runtime.<\/p>\n<p>Finally, the Servlet is mapped to <em>\/<\/em> \u2013 meaning it becomes the <strong>default Servlet<\/strong> of the application and it will pick up every pattern that doesn\u2019t have another exact match defined by another Servlet.<\/p>\n<h2>3. The View Configuration<\/h2>\n<p>The Spring MVC Java configuration is simple \u2013 it uses the MVC configuration support introduced in Spring 3.1:<\/p>\n<pre class=\" brush:java\">@EnableWebMvc\r\n@Configuration\r\npublic class ClientWebConfig extends WebMvcConfigurerAdapter {\r\n\r\n   @Override\r\n   public void addViewControllers(ViewControllerRegistry registry) {\r\n      super.addViewControllers(registry);\r\n\r\n      registry.addViewController(\"\/sample.html\");\r\n   }\r\n\r\n   @Bean\r\n   public ViewResolver viewResolver() {\r\n      InternalResourceViewResolver bean = new InternalResourceViewResolver();\r\n\r\n      bean.setViewClass(JstlView.class);\r\n      bean.setPrefix(\"\/WEB-INF\/view\/\");\r\n      bean.setSuffix(\".jsp\");\r\n\r\n      return bean;\r\n   }\r\n}<\/pre>\n<p>Very important here is that we can register view controllers that create a direct mapping between the URL and the view name \u2013 <strong>no need for any Controller<\/strong> between the two now that we\u2019re using Java configuration.<\/p>\n<h2>4. The JSP Views<\/h2>\n<p>We defined above a basic view controller \u2013 <em>sample.html<\/em> \u2013 the corresponding jsp resource is:<\/p>\n<pre class=\" brush:xml\">&lt;html&gt;\r\n   &lt;head&gt;&lt;\/head&gt;\r\n\r\n   &lt;body&gt;\r\n      &lt;h1&gt;This is the body of the sample view&lt;\/h1&gt;\t\r\n   &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>The JSP based view files are located under the \/<em>WEB-INF<\/em> folder of the project, so they\u2019re only accessible to the Spring infrastructure and not by direct URL access.<\/p>\n<h2>5. Conclusion<\/h2>\n<p>In this example we configured a simple and functional Spring MVC project, using Java configuration. The implementation of this simple Spring MVC tutorial can be found in <a title=\"Spring MVC Tutorial\" href=\"https:\/\/github.com\/eugenp\/tutorials\/tree\/master\/spring-mvc-java#readme\" target=\"_blank\" rel=\"nofollow\">the github project<\/a> \u2013 this is an Eclipse based project, so it should be easy to import and run as it is.<\/p>\n<p>When the project runs locally, the <em>sample.html<\/em> can be accessed at:<\/p>\n<ul>\n<li><a title=\"Sample View on localhost\" href=\"http:\/\/localhost:8080\/spring-mvc\/sample.html\" target=\"_blank\" rel=\"nofollow\">http:\/\/localhost:8080\/spring-mvc\/sample.html<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div style=\"border: 1px solid #D8D8D8; background: #FAFAFA; width: 100%; padding-left: 5px;\"><b><i>Reference: <\/i><\/b><a href=\"http:\/\/www.baeldung.com\/spring-mvc-tutorial\">Spring MVC Tutorial<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Eugen Paraschiv at the <a href=\"http:\/\/www.baeldung.com\/\">baeldung<\/a> blog.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>1. Overview and Maven This is a simple Spring MVC tutorial showing how to set up a Spring MVC project, both with Java based Configuration as well as with XML Configuration. The Maven artifacts for Spring MVC project are described in the in detail in the Spring MVC dependencies article. 2. The web.xml This is &hellip;<\/p>\n","protected":false},"author":104,"featured_media":240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[30,150],"class_list":["post-16841","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-spring","tag-spring-mvc"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Spring MVC Tutorial<\/title>\n<meta name=\"description\" content=\"1. Overview and Maven This is a simple Spring MVC tutorial showing how to set up a Spring MVC project, both with Java based Configuration as well as with\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring MVC Tutorial\" \/>\n<meta property=\"og:description\" content=\"1. Overview and Maven This is a simple Spring MVC tutorial showing how to set up a Spring MVC project, both with Java based Configuration as well as with\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2013-05-15T07:00:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-09-03T22:11:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Eugen Paraschiv\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/twitter.com\/baeldung\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Eugen Paraschiv\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-tutorial.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-tutorial.html\"},\"author\":{\"name\":\"Eugen Paraschiv\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/7a8ad27f4bb34bb3664fda07d3142bc4\"},\"headline\":\"Spring MVC Tutorial\",\"datePublished\":\"2013-05-15T07:00:25+00:00\",\"dateModified\":\"2013-09-03T22:11:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-tutorial.html\"},\"wordCount\":364,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-tutorial.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"keywords\":[\"Spring\",\"Spring MVC\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-tutorial.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-tutorial.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-tutorial.html\",\"name\":\"Spring MVC Tutorial\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-tutorial.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-tutorial.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"datePublished\":\"2013-05-15T07:00:25+00:00\",\"dateModified\":\"2013-09-03T22:11:13+00:00\",\"description\":\"1. Overview and Maven This is a simple Spring MVC tutorial showing how to set up a Spring MVC project, both with Java based Configuration as well as with\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-tutorial.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-tutorial.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-tutorial.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"spring-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-tutorial.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Spring MVC Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/7a8ad27f4bb34bb3664fda07d3142bc4\",\"name\":\"Eugen Paraschiv\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d1e55876feb753ccc6de08d413df2c915e5704dd901010340c1499a7572f8d7a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d1e55876feb753ccc6de08d413df2c915e5704dd901010340c1499a7572f8d7a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d1e55876feb753ccc6de08d413df2c915e5704dd901010340c1499a7572f8d7a?s=96&d=mm&r=g\",\"caption\":\"Eugen Paraschiv\"},\"sameAs\":[\"http:\\\/\\\/www.baeldung.com\\\/\",\"http:\\\/\\\/www.linkedin.com\\\/in\\\/eugenparaschiv\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/twitter.com\\\/baeldung\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Eugen-Paraschiv\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring MVC Tutorial","description":"1. Overview and Maven This is a simple Spring MVC tutorial showing how to set up a Spring MVC project, both with Java based Configuration as well as with","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html","og_locale":"en_US","og_type":"article","og_title":"Spring MVC Tutorial","og_description":"1. Overview and Maven This is a simple Spring MVC tutorial showing how to set up a Spring MVC project, both with Java based Configuration as well as with","og_url":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-05-15T07:00:25+00:00","article_modified_time":"2013-09-03T22:11:13+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","type":"image\/jpeg"}],"author":"Eugen Paraschiv","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/twitter.com\/baeldung","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Eugen Paraschiv","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html"},"author":{"name":"Eugen Paraschiv","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/7a8ad27f4bb34bb3664fda07d3142bc4"},"headline":"Spring MVC Tutorial","datePublished":"2013-05-15T07:00:25+00:00","dateModified":"2013-09-03T22:11:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html"},"wordCount":364,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","keywords":["Spring","Spring MVC"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html","url":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html","name":"Spring MVC Tutorial","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","datePublished":"2013-05-15T07:00:25+00:00","dateModified":"2013-09-03T22:11:13+00:00","description":"1. Overview and Maven This is a simple Spring MVC tutorial showing how to set up a Spring MVC project, both with Java based Configuration as well as with","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","width":150,"height":150,"caption":"spring-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-tutorial.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Spring MVC Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/7a8ad27f4bb34bb3664fda07d3142bc4","name":"Eugen Paraschiv","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d1e55876feb753ccc6de08d413df2c915e5704dd901010340c1499a7572f8d7a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d1e55876feb753ccc6de08d413df2c915e5704dd901010340c1499a7572f8d7a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d1e55876feb753ccc6de08d413df2c915e5704dd901010340c1499a7572f8d7a?s=96&d=mm&r=g","caption":"Eugen Paraschiv"},"sameAs":["http:\/\/www.baeldung.com\/","http:\/\/www.linkedin.com\/in\/eugenparaschiv","https:\/\/x.com\/http:\/\/twitter.com\/baeldung"],"url":"https:\/\/www.javacodegeeks.com\/author\/Eugen-Paraschiv"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/16841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/104"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=16841"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/16841\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/240"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=16841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=16841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=16841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}