{"id":99135,"date":"2019-10-11T10:00:09","date_gmt":"2019-10-11T07:00:09","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=99135"},"modified":"2019-10-09T12:48:32","modified_gmt":"2019-10-09T09:48:32","slug":"spring-requestparam-annotation","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2019\/10\/spring-requestparam-annotation.html","title":{"rendered":"Spring @RequestParam Annotation"},"content":{"rendered":"<h3 class=\"wp-block-heading\">Introduction:<\/h3>\n<p>Spring <em>@RequestParam<\/em> annotation<strong> can be used to extract the query parameters in a handler method.<\/strong> In this quick tutorial, we\u2019ll learn its usage.<\/p>\n<h3 class=\"wp-block-heading\"><em>@RequestParam<\/em> Annotation:<\/h3>\n<p>Let\u2019s first expose an API which returns a list of users with a given first name&nbsp;and age:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">@RestController\npublic class UserController {\n&nbsp;&nbsp;&nbsp;&nbsp;...\n&nbsp;&nbsp;&nbsp;&nbsp;@GetMapping(\"\/users\")\n&nbsp;&nbsp;&nbsp;&nbsp;public List&lt;User&gt; getUsers(@RequestParam String firstName, @RequestParam int age) {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return userService.findUsersWith(firstName, age);\n&nbsp;&nbsp;&nbsp;&nbsp;}\n}\n<\/pre>\n<p>And now, let\u2019s use <em>cURL<\/em> to quickly test this out:<\/p>\n<pre class=\"wp-block-preformatted brush:shell\">curl -XGET 'http:\/\/localhost:8080\/users?firstName=John&amp;age=15'\n...\n[{firstName = John ,lastName = Mason ,age = 15}\n&nbsp;&nbsp;, {firstName = John ,lastName = Dash ,age = 15}]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \n<\/pre>\n<p>As we can see, t<strong>he <em>firstName<\/em> and <em>age<\/em> are the query parameters that got correctly mapped to our handler method.<\/strong><\/p>\n<h3 class=\"wp-block-heading\">Attributes of <em>@RequestParam<\/em>:<\/h3>\n<p>The <em>@RequestParam<\/em> annotation supports the usage of several attributes to cater to various common needs:<\/p>\n<h3 class=\"wp-block-heading\">1. <em>name<\/em>\/<em>value<\/em>:<\/h3>\n<p>In the example we just covered, we\u2019ll notice that the names of the method argument and query parameter were the same (<em>firstName<\/em> and <em>age<\/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>However, <strong>at times, we might feel the need to have different names. For that, we\u2019ll use its <em>name<\/em> or <em>value<\/em> attribute<\/strong>:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">@GetMapping(\"\/users\")\npublic List&lt;User&gt; getUsers(@RequestParam(name=\"uName\") String firstName\n&nbsp;&nbsp;, @RequestParam(\"uAge\") int age) {\n&nbsp;&nbsp;&nbsp;&nbsp;return userService.findUsersWith(firstName, age); \n}\n<\/pre>\n<p>With this, the <em>uName<\/em> and <em>uAge<\/em> parameters will map to the <em>firstName<\/em> and <em>age<\/em> method arguments respectively:<\/p>\n<pre class=\"wp-block-preformatted brush:shell\">curl -XGET 'http:\/\/localhost:8080\/users?uName=John&amp;uAge=15'\n<\/pre>\n<h3 class=\"wp-block-heading\">2. <em>required<\/em>:<\/h3>\n<p>By default,&nbsp;<strong>if we define a request parameter and don\u2019t pass it in the user request, we\u2019ll get an error.<\/strong><\/p>\n<p>To avoid that, we can set the <em>required<\/em> to <em>false:<\/em><\/p>\n<pre class=\"wp-block-preformatted brush:java\">@GetMapping(\"\/users\") \npublic List&lt;User&gt; getUsers(@RequestParam(required=false) String firstName\n , @RequestParam int age) {\n&nbsp;&nbsp;&nbsp;&nbsp;return userService.findUsersWith(firstName, age); \n}\n<\/pre>\n<p><strong>It\u2019ll assign data type defaults to all optional parameters.<\/strong> When we hit below URL:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">http:\/\/localhost:8080\/users?age=15<\/pre>\n<p>the <em>firstName<\/em> will get mapped to a <em>null<\/em> value.<\/p>\n<h3 class=\"wp-block-heading\">3. <em>defaultValue<\/em>:<\/h3>\n<p><strong>If we want to set the <em>required<\/em> to <em>false<\/em> and also map a default value to the concerned attribute, we\u2019ll have:<\/strong><\/p>\n<pre class=\"wp-block-preformatted brush:java\">@GetMapping(\"\/users\") \npublic List&lt;User&gt; getUsers(@RequestParam(defaultValue=\"John\") String firstName,\n&nbsp;&nbsp;@RequestParam int age) { \n&nbsp;&nbsp;&nbsp;&nbsp;return userService.findUsersWith(firstName, age); \n}\n<\/pre>\n<p>Here, if we don\u2019t pass the <em>firstName&nbsp;<\/em>query parameter, it\u2019ll assume it to be<em> \u2018John\u2019<\/em>.<\/p>\n<h3 class=\"wp-block-heading\"><em>@RequestParam<\/em> with Java <em>List<\/em>:<\/h3>\n<p>We can accept a list of query parameters in a Java <em>List:<\/em><\/p>\n<pre class=\"wp-block-preformatted brush:java\">@GetMapping(\"\/users\/v2\")\npublic List&lt;User> getUsersWithGivenAges(@RequestParam List&lt;Integer> age) {\n\u00a0\u00a0\u00a0\u00a0return userService.findUsersWithAges(age);\n}<\/pre>\n<p>To use our new users <em>API, <\/em>we\u2019ll have something as:<\/p>\n<pre class=\"wp-block-preformatted brush:shell\">curl -XGET 'http:\/\/localhost:8080\/users\/v2?age=10,15,20'\n\u00a0\nOr\n\u00a0\ncurl -XGET 'http:\/\/localhost:8080\/users\/v2?age=10&amp;age=15&amp;age=20'<\/pre>\n<h3 class=\"wp-block-heading\">Retrieve All Parameters:<\/h3>\n<p>To retrieve all passed query parameters from a user request, we\u2019ll accept them as a Java <em>Map<\/em>:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">@GetMapping(\"\/paramsEx\")\npublic Map&lt;String, String&gt; \n&nbsp;&nbsp;printParams(@RequestParam Map&lt;String, String&gt; allQueryParams) {\n&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(allQueryParams); \n&nbsp;&nbsp;&nbsp;&nbsp;return allQueryParams; \n}\n<\/pre>\n<p>This comes handy when we want to retrieve all parameters without knowing their names:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">curl -XGET 'http:\/\/localhost:8080\/paramsEx?param1=A&amp;param2=B&amp;param3=2'\n...\n{param1=A, param2=B, param3=2}\n<\/pre>\n<h3 class=\"wp-block-heading\">Conclusion:<\/h3>\n<p>In this tutorial, we learned how to work with <em>@RequestParam<\/em> annotation in a Spring application.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>Published on Java Code Geeks with permission by Shubhra Srivastava, partner at our <a href=\"\/\/www.javacodegeeks.com\/join-us\/jcg\/\" target=\"_blank\" rel=\"noopener noreferrer\">JCG program<\/a>. See the original article here: <a href=\"http:\/\/www.programmergirl.com\/spring-requestparam-annotation\/\" target=\"_blank\" rel=\"noopener noreferrer\">Spring @RequestParam Annotation<\/a><\/p>\n<p>Opinions expressed by Java Code Geeks contributors are their own.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: Spring @RequestParam annotation can be used to extract the query parameters in a handler method. In this quick tutorial, we\u2019ll learn its usage. @RequestParam Annotation: Let\u2019s first expose an API which returns a list of users with a given first name&nbsp;and age: @RestController public class UserController { &nbsp;&nbsp;&nbsp;&nbsp;&#8230; &nbsp;&nbsp;&nbsp;&nbsp;@GetMapping(&#8220;\/users&#8221;) &nbsp;&nbsp;&nbsp;&nbsp;public List&lt;User&gt; getUsers(@RequestParam String firstName, &hellip;<\/p>\n","protected":false},"author":82253,"featured_media":240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[30],"class_list":["post-99135","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-spring"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Spring @RequestParam Annotation - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn about @RequestParam? Check our article explaining how to work with @RequestParam annotation in a Spring application.\" \/>\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\/2019\/10\/spring-requestparam-annotation.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring @RequestParam Annotation - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn about @RequestParam? Check our article explaining how to work with @RequestParam annotation in a Spring application.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2019\/10\/spring-requestparam-annotation.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=\"2019-10-11T07:00:09+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=\"Shubhra Srivastava\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Shubhra Srivastava\" \/>\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\\\/2019\\\/10\\\/spring-requestparam-annotation.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/10\\\/spring-requestparam-annotation.html\"},\"author\":{\"name\":\"Shubhra Srivastava\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/b73b076dc62e72de203df7018d398e56\"},\"headline\":\"Spring @RequestParam Annotation\",\"datePublished\":\"2019-10-11T07:00:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/10\\\/spring-requestparam-annotation.html\"},\"wordCount\":375,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/10\\\/spring-requestparam-annotation.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"keywords\":[\"Spring\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/10\\\/spring-requestparam-annotation.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/10\\\/spring-requestparam-annotation.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/10\\\/spring-requestparam-annotation.html\",\"name\":\"Spring @RequestParam Annotation - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/10\\\/spring-requestparam-annotation.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/10\\\/spring-requestparam-annotation.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"datePublished\":\"2019-10-11T07:00:09+00:00\",\"description\":\"Interested to learn about @RequestParam? Check our article explaining how to work with @RequestParam annotation in a Spring application.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/10\\\/spring-requestparam-annotation.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/10\\\/spring-requestparam-annotation.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/10\\\/spring-requestparam-annotation.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\\\/2019\\\/10\\\/spring-requestparam-annotation.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 @RequestParam Annotation\"}]},{\"@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\\\/b73b076dc62e72de203df7018d398e56\",\"name\":\"Shubhra Srivastava\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9e5d3b016140986463a886392b8400e55ed0aa7742ef29b86a54bd8d5743b68a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9e5d3b016140986463a886392b8400e55ed0aa7742ef29b86a54bd8d5743b68a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9e5d3b016140986463a886392b8400e55ed0aa7742ef29b86a54bd8d5743b68a?s=96&d=mm&r=g\",\"caption\":\"Shubhra Srivastava\"},\"description\":\"Shubhra is a software professional and founder of ProgrammerGirl. She has a great experience with Java\\\/J2EE technologies and frameworks. She loves the amalgam of programming and coffee :)\",\"sameAs\":[\"http:\\\/\\\/www.programmergirl.com\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/shubhra-srivastava224\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/shubhra-srivastava\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring @RequestParam Annotation - Java Code Geeks","description":"Interested to learn about @RequestParam? Check our article explaining how to work with @RequestParam annotation in a Spring application.","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\/2019\/10\/spring-requestparam-annotation.html","og_locale":"en_US","og_type":"article","og_title":"Spring @RequestParam Annotation - Java Code Geeks","og_description":"Interested to learn about @RequestParam? Check our article explaining how to work with @RequestParam annotation in a Spring application.","og_url":"https:\/\/www.javacodegeeks.com\/2019\/10\/spring-requestparam-annotation.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2019-10-11T07:00:09+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":"Shubhra Srivastava","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Shubhra Srivastava","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2019\/10\/spring-requestparam-annotation.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/10\/spring-requestparam-annotation.html"},"author":{"name":"Shubhra Srivastava","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/b73b076dc62e72de203df7018d398e56"},"headline":"Spring @RequestParam Annotation","datePublished":"2019-10-11T07:00:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/10\/spring-requestparam-annotation.html"},"wordCount":375,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/10\/spring-requestparam-annotation.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","keywords":["Spring"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2019\/10\/spring-requestparam-annotation.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2019\/10\/spring-requestparam-annotation.html","url":"https:\/\/www.javacodegeeks.com\/2019\/10\/spring-requestparam-annotation.html","name":"Spring @RequestParam Annotation - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/10\/spring-requestparam-annotation.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/10\/spring-requestparam-annotation.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","datePublished":"2019-10-11T07:00:09+00:00","description":"Interested to learn about @RequestParam? Check our article explaining how to work with @RequestParam annotation in a Spring application.","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/10\/spring-requestparam-annotation.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2019\/10\/spring-requestparam-annotation.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2019\/10\/spring-requestparam-annotation.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\/2019\/10\/spring-requestparam-annotation.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 @RequestParam Annotation"}]},{"@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\/b73b076dc62e72de203df7018d398e56","name":"Shubhra Srivastava","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9e5d3b016140986463a886392b8400e55ed0aa7742ef29b86a54bd8d5743b68a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9e5d3b016140986463a886392b8400e55ed0aa7742ef29b86a54bd8d5743b68a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9e5d3b016140986463a886392b8400e55ed0aa7742ef29b86a54bd8d5743b68a?s=96&d=mm&r=g","caption":"Shubhra Srivastava"},"description":"Shubhra is a software professional and founder of ProgrammerGirl. She has a great experience with Java\/J2EE technologies and frameworks. She loves the amalgam of programming and coffee :)","sameAs":["http:\/\/www.programmergirl.com","https:\/\/www.linkedin.com\/in\/shubhra-srivastava224\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/shubhra-srivastava"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/99135","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\/82253"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=99135"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/99135\/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=99135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=99135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=99135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}