{"id":818,"date":"2022-08-17T16:42:23","date_gmt":"2023-07-26T21:25:03","guid":{"rendered":"https:\/\/www.silicloud.com\/blog\/uncategorized\/spring-controller-is-the-same-as-spring-mvc-controller\/"},"modified":"2024-03-11T15:10:41","modified_gmt":"2024-03-11T15:10:41","slug":"spring-mvc-controller","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/","title":{"rendered":"Spring MVC Controller"},"content":{"rendered":"<p>The Spring Controller annotation is a more specific version of the @Component annotation. It is commonly used with annotated handler methods that are based on the RequestMapping annotation.<\/p>\n<h2>Spring Controller &#8211; A controller component in the Spring framework.<\/h2>\n<p>The Controller annotation can only be used on classes and is utilized to designate a class as a handler for web requests. This annotation is predominantly employed in Spring MVC applications.<\/p>\n<h2>Spring RestController can be rephrased as &#8220;Spring&#8217;s RestController&#8221; or &#8220;RestController provided by Spring.&#8221;<\/h2>\n<p>The Spring @RestController annotation is a shortcut for @Controller and @ResponseBody combined, typically used to indicate that a class serves as a request handler for RESTful web services.<\/p>\n<h2>An example of a Spring Controller.<\/h2>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/655cd0f6c40ba52feef288e7\/6-0.png\" alt=\"Spring Controller Example Project\" \/><\/div>\n<pre class=\"post-pre\"><code>&lt;dependency&gt;\r\n\t&lt;groupId&gt;org.springframework&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;spring-webmvc&lt;\/artifactId&gt;\r\n\t&lt;version&gt;5.0.7.RELEASE&lt;\/version&gt;\r\n&lt;\/dependency&gt;\r\n&lt;dependency&gt;\r\n\t&lt;groupId&gt;org.springframework&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;spring-web&lt;\/artifactId&gt;\r\n\t&lt;version&gt;5.0.7.RELEASE&lt;\/version&gt;\r\n&lt;\/dependency&gt;\r\n\r\n&lt;!-- Jackson for REST --&gt;\r\n&lt;dependency&gt;\r\n\t&lt;groupId&gt;com.fasterxml.jackson.core&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;jackson-databind&lt;\/artifactId&gt;\r\n\t&lt;version&gt;2.9.6&lt;\/version&gt;\r\n&lt;\/dependency&gt;\r\n<\/code><\/pre>\n<p>In this case, we will examine the deployment descriptor (web.xml) to set up the DispatcherServlet servlet as the primary controller.<\/p>\n<pre class=\"post-pre\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;web-app xmlns:xsi=\"https:\/\/www.w3.org\/2001\/XMLSchema-instance\" xmlns=\"https:\/\/xmlns.jcp.org\/xml\/ns\/javaee\" \r\n xsi:schemaLocation=\"https:\/\/xmlns.jcp.org\/xml\/ns\/javaee https:\/\/xmlns.jcp.org\/xml\/ns\/javaee\/web-app_3_1.xsd\" id=\"WebApp_ID\" version=\"3.1\"&gt;\r\n  &lt;display-name&gt;Spring-Controller&lt;\/display-name&gt;\r\n  &lt;!-- Add Spring MVC DispatcherServlet as front controller --&gt;\r\n\t&lt;servlet&gt;\r\n        &lt;servlet-name&gt;spring&lt;\/servlet-name&gt;\r\n        &lt;servlet-class&gt;\r\n                org.springframework.web.servlet.DispatcherServlet\r\n        &lt;\/servlet-class&gt;\r\n        &lt;init-param&gt;\r\n       \t\t&lt;param-name&gt;contextConfigLocation&lt;\/param-name&gt;\r\n       \t\t&lt;param-value&gt;\/WEB-INF\/spring-servlet.xml&lt;\/param-value&gt;\r\n    \t\t&lt;\/init-param&gt;\r\n        &lt;load-on-startup&gt;1&lt;\/load-on-startup&gt;\r\n    &lt;\/servlet&gt;\r\n \r\n    &lt;servlet-mapping&gt;\r\n        &lt;servlet-name&gt;spring&lt;\/servlet-name&gt;\r\n        &lt;url-pattern&gt;\/&lt;\/url-pattern&gt; \r\n    &lt;\/servlet-mapping&gt;\r\n&lt;\/web-app&gt;\r\n<\/code><\/pre>\n<p>Lastly, we possess the subsequent spring context file. In this file, we set up our application for annotation-based configuration and specify the root package to scan for spring components. Additionally, we configure the InternalResourceViewResolver bean and provide specifics about the view pages.<\/p>\n<pre class=\"post-pre\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;beans:beans xmlns=\"https:\/\/www.springframework.org\/schema\/mvc\"\r\n\txmlns:xsi=\"https:\/\/www.w3.org\/2001\/XMLSchema-instance\" xmlns:beans=\"https:\/\/www.springframework.org\/schema\/beans\"\r\n\txmlns:context=\"https:\/\/www.springframework.org\/schema\/context\"\r\n\txsi:schemaLocation=\"https:\/\/www.springframework.org\/schema\/mvc https:\/\/www.springframework.org\/schema\/mvc\/spring-mvc.xsd\r\n\t\thttps:\/\/www.springframework.org\/schema\/beans https:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd\r\n\t\thttps:\/\/www.springframework.org\/schema\/context https:\/\/www.springframework.org\/schema\/context\/spring-context.xsd\"&gt;\r\n\r\n\t&lt;!-- Enables the Spring MVC @Controller programming model --&gt;\r\n\t&lt;annotation-driven \/&gt;\r\n\r\n\t&lt;context:component-scan base-package=\"com.scdev.spring\" \/&gt;\r\n\r\n\t&lt;!-- Resolves views selected for rendering by @Controllers to JSP resources \r\n\t\tin the \/WEB-INF\/views directory --&gt;\r\n\t&lt;beans:bean\r\n\t\tclass=\"org.springframework.web.servlet.view.InternalResourceViewResolver\"&gt;\r\n\t\t&lt;beans:property name=\"prefix\" value=\"\/WEB-INF\/views\/\" \/&gt;\r\n\t\t&lt;beans:property name=\"suffix\" value=\".jsp\" \/&gt;\r\n\t&lt;\/beans:bean&gt;\r\n\r\n&lt;\/beans:beans&gt;\r\n<\/code><\/pre>\n<p>Our Controller class will be our next focus as our configuration XML files have been prepared.<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.spring.controller;\r\n\r\nimport java.text.DateFormat;\r\nimport java.util.Date;\r\nimport java.util.Locale;\r\n\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.ui.Model;\r\nimport org.springframework.web.bind.annotation.GetMapping;\r\n\r\n@Controller\r\npublic class HomeController {\r\n\r\n\t@GetMapping(\"\/hello\")\r\n\tpublic String home(Locale locale, Model model) {\r\n\t\tDate date = new Date();\r\n\t\tDateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);\r\n\t\tString formattedDate = dateFormat.format(date);\r\n\t\tmodel.addAttribute(\"serverTime\", formattedDate);\r\n\t\treturn \"home\";\r\n\t}\r\n\r\n}\r\n<\/code><\/pre>\n<p>We have created a request handler method specifically for receiving GET requests with the URI &#8220;\/hello&#8221; and responding with the &#8220;home.jsp&#8221; page. It is important to note that we have also assigned a value to a model attribute, which will be utilized on the home.jsp page. Below is the code for our straightforward home.jsp page.<\/p>\n<pre class=\"post-pre\"><code>&lt;%@ page language=\"java\" contentType=\"text\/html; charset=UTF-8\"\r\n\tpageEncoding=\"UTF-8\"%&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Home&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\t&lt;h1&gt;Hello world!&lt;\/h1&gt;\r\n\r\n\t&lt;p&gt;The time on the server is ${serverTime}.&lt;\/p&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/code><\/pre>\n<h2>Testing of Spring <a href=\"https:\/\/en.wikipedia.org\/wiki\/Model\u2013view\u2013controller\">MVC<\/a> Controllers<\/h2>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/655cd0f6c40ba52feef288e7\/17-0.png\" alt=\"Spring Controller Example\" \/><\/div>\n<h2>Example of a Spring RestController.<\/h2>\n<p>Let&#8217;s now enhance our application to also provide REST APIs. Develop a model class that will be transmitted as a JSON response.<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.spring.model;\r\n\r\npublic class Person {\r\n\r\n\tprivate String name;\r\n\r\n\tpublic String getName() {\r\n\t\treturn name;\r\n\t}\r\n\r\n\tpublic void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}\r\n\t\r\n}\r\n<\/code><\/pre>\n<p>This is our elementary REST Controller class.<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.spring.controller;\r\n\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RequestParam;\r\nimport org.springframework.web.bind.annotation.RestController;\r\n\r\nimport com.scdev.spring.model.Person;\r\n\r\n@RestController\r\npublic class PersonRESTController {\r\n\r\n\t@RequestMapping(\"\/rest\")\r\n\tpublic String healthCheck() {\r\n\t\treturn \"OK\";\r\n\t}\r\n\r\n\t@RequestMapping(\"\/rest\/person\/get\")\r\n\tpublic Person getPerson(@RequestParam(name = \"name\", required = false, defaultValue = \"Unknown\") String name) {\r\n\t\tPerson person = new Person();\r\n\t\tperson.setName(name);\r\n\t\treturn person;\r\n\t}\r\n\r\n}\r\n<\/code><\/pre>\n<p>Please test our REST APIs by redeploying the application once more.<\/p>\n<h2>Testing the REST Controller of Spring.<\/h2>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/655cd0f6c40ba52feef288e7\/25-2.png\" alt=\"Spring REST Controller Example\" \/><\/div>\n<h2>Give me a single option to paraphrase the following natively: &#8220;Provide a brief overview.&#8221;<\/h2>\n<p>The Spring Controller serves as the foundation for Spring MVC applications, initiating our business logic. Additionally, the RestController simplifies the creation of REST-based web services.<\/p>\n<p>The example project code is available for download on our GitHub Repository.<\/p>\n<p>&nbsp;<\/p>\n<p>more tutorials<\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/spring-component-annotation\/\" target=\"_blank\" rel=\"noopener\">Spring Component annotation<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/spring-mvc-handlerinterceptoradapter-and-handlerinterceptor\/\" target=\"_blank\" rel=\"noopener\">Spring MVC HandlerInterceptorAdapter and HandlerInterceptor.<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/spring-rest-xml-and-json\/\" target=\"_blank\" rel=\"noopener\">One example of Spring REST XML and JSON<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/spring-boot-cli\/\" target=\"_blank\" rel=\"noopener\">Spring Boot CLI<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/how-to-integrate-playwright-for-react-application-component-testing\/\" target=\"_blank\" rel=\"noopener\">React Application Component Testing Integrate with Playwright<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Spring Controller annotation is a more specific version of the @Component annotation. It is commonly used with annotated handler methods that are based on the RequestMapping annotation. Spring Controller &#8211; A controller component in the Spring framework. The Controller annotation can only be used on classes and is utilized to designate a class as [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-818","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Spring MVC Controller - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"The Spring Controller annotation is a more specific version of the @Component annotation. It is commonly used with annotated handler\" \/>\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.silicloud.com\/blog\/spring-mvc-controller\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring MVC Controller\" \/>\n<meta property=\"og:description\" content=\"The Spring Controller annotation is a more specific version of the @Component annotation. It is commonly used with annotated handler\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-26T21:25:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-11T15:10:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/655cd0f6c40ba52feef288e7\/6-0.png\" \/>\n<meta name=\"author\" content=\"Ava Mitchell\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:site\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ava Mitchell\" \/>\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.silicloud.com\/blog\/spring-mvc-controller\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/\"},\"author\":{\"name\":\"Ava Mitchell\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/a3e2658c2cb9fb2be95ae0a8861f4a64\"},\"headline\":\"Spring MVC Controller\",\"datePublished\":\"2023-07-26T21:25:03+00:00\",\"dateModified\":\"2024-03-11T15:10:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/\"},\"wordCount\":425,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/\",\"name\":\"Spring MVC Controller - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\"},\"datePublished\":\"2023-07-26T21:25:03+00:00\",\"dateModified\":\"2024-03-11T15:10:41+00:00\",\"description\":\"The Spring Controller annotation is a more specific version of the @Component annotation. It is commonly used with annotated handler\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.silicloud.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Spring MVC Controller\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"name\":\"Silicon Cloud Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\",\"name\":\"Silicon Cloud Blog\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"contentUrl\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"width\":1024,\"height\":1024,\"caption\":\"Silicon Cloud Blog\"},\"image\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\",\"https:\/\/twitter.com\/SiliCloudGlobal\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/a3e2658c2cb9fb2be95ae0a8861f4a64\",\"name\":\"Ava Mitchell\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/15c63cd0564b4a2e07d611bcdffa296f6ea80e8db07c3091f43a84010514899d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/15c63cd0564b4a2e07d611bcdffa296f6ea80e8db07c3091f43a84010514899d?s=96&d=mm&r=g\",\"caption\":\"Ava Mitchell\"},\"url\":\"https:\/\/www.silicloud.com\/blog\/author\/avamitchell\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Spring MVC Controller - Blog - Silicon Cloud","description":"The Spring Controller annotation is a more specific version of the @Component annotation. It is commonly used with annotated handler","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.silicloud.com\/blog\/spring-mvc-controller\/","og_locale":"en_US","og_type":"article","og_title":"Spring MVC Controller","og_description":"The Spring Controller annotation is a more specific version of the @Component annotation. It is commonly used with annotated handler","og_url":"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/","og_site_name":"Blog - Silicon Cloud","article_publisher":"https:\/\/www.facebook.com\/SiliCloudGlobal\/","article_published_time":"2023-07-26T21:25:03+00:00","article_modified_time":"2024-03-11T15:10:41+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/655cd0f6c40ba52feef288e7\/6-0.png"}],"author":"Ava Mitchell","twitter_card":"summary_large_image","twitter_creator":"@SiliCloudGlobal","twitter_site":"@SiliCloudGlobal","twitter_misc":{"Written by":"Ava Mitchell","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/#article","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/"},"author":{"name":"Ava Mitchell","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/a3e2658c2cb9fb2be95ae0a8861f4a64"},"headline":"Spring MVC Controller","datePublished":"2023-07-26T21:25:03+00:00","dateModified":"2024-03-11T15:10:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/"},"wordCount":425,"commentCount":0,"publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/","url":"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/","name":"Spring MVC Controller - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/#website"},"datePublished":"2023-07-26T21:25:03+00:00","dateModified":"2024-03-11T15:10:41+00:00","description":"The Spring Controller annotation is a more specific version of the @Component annotation. It is commonly used with annotated handler","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/blog\/spring-mvc-controller\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.silicloud.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Spring MVC Controller"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/blog\/#website","url":"https:\/\/www.silicloud.com\/blog\/","name":"Silicon Cloud Blog","description":"","publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.silicloud.com\/blog\/#organization","name":"Silicon Cloud Blog","url":"https:\/\/www.silicloud.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","contentUrl":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","width":1024,"height":1024,"caption":"Silicon Cloud Blog"},"image":{"@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/SiliCloudGlobal\/","https:\/\/twitter.com\/SiliCloudGlobal"]},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/a3e2658c2cb9fb2be95ae0a8861f4a64","name":"Ava Mitchell","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/15c63cd0564b4a2e07d611bcdffa296f6ea80e8db07c3091f43a84010514899d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/15c63cd0564b4a2e07d611bcdffa296f6ea80e8db07c3091f43a84010514899d?s=96&d=mm&r=g","caption":"Ava Mitchell"},"url":"https:\/\/www.silicloud.com\/blog\/author\/avamitchell\/"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/818","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/comments?post=818"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/818\/revisions"}],"predecessor-version":[{"id":1862,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/818\/revisions\/1862"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/media?parent=818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/categories?post=818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/tags?post=818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}