{"id":51071,"date":"2016-01-18T10:00:46","date_gmt":"2016-01-18T08:00:46","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=51071"},"modified":"2016-01-17T21:22:46","modified_gmt":"2016-01-17T19:22:46","slug":"java-ee-8-mvc-working-query-parameters","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.html","title":{"rendered":"Java EE 8 MVC: Working with query parameters"},"content":{"rendered":"<p>In the previous post about the new Java EE MVC Framework we had <a href=\"http:\/\/www.javacodegeeks.com\/2015\/10\/java-ee-8-mvc-a-detailed-look-at-controllers.html\">a detailed look on Controllers<\/a>. In this and the following posts we will see how to access various types of request data in MVC Controllers.<\/p>\n<p>Java EE MVC makes heavy use of JAX-RS and most of the things we will see in this and the next posts are JAX-RS features. So, if you are familiar with JAX-RS you probably will not learn much new in this post.<\/p>\n<h2>Query parameters<\/h2>\n<p>This post focuses on query parameters. If you read my <a href=\"http:\/\/www.javacodegeeks.com\/2015\/09\/java-ee-8-mvc-getting-started-with-ozark.html\">Java EE MVC Getting started<\/a> post you might already know the <code>@QueryParam<\/code> annotation. The most common use case of\u00a0 <code>@QueryParam<\/code> is to map a query parameter to a controller method parameter.<\/p>\n<p>For example:<\/p>\n<pre class=\" brush:java\">@Controller\r\n@Path(\"query-params\")\r\npublic class QueryParamsController {\r\n\r\n  @GET\r\n  public String queryParams(@QueryParam(\"name\") String name) {\r\n    ...\r\n  }\r\n}<\/pre>\n<p>If we now send a HTTP GET request to:<\/p>\n<pre class=\" brush:bash\">\/query-params?name=john<\/pre>\n<p>the string &#8220;<code>john<\/code>&#8221; will be passed as <code>name<\/code> parameter to the method <code>queryParams()<\/code>.<\/p>\n<h2>Type conversion<\/h2>\n<p>With <code>@QueryParam<\/code> query parameters can automatically be converted to various types.<\/p>\n<p>For example:<\/p>\n<pre class=\" brush:java\">public enum Role {\r\n  admin, reporter, accountant\r\n}<\/pre>\n<pre class=\" brush:java\">@Controller\r\n@Path(\"query-params\")\r\npublic class QueryParamsController {\r\n\r\n  @GET\r\n  public String queryParams(\r\n      @QueryParam(\"id\") long id,\r\n      @QueryParam(\"name\") String name,\r\n      @QueryParam(\"role\") Role role) {\r\n\r\n    ...\r\n  }\r\n}<\/pre>\n<p>We can now send a request like this:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\" brush:java\">\/query-params?id=42&amp;name=john&amp;role=admin<\/pre>\n<p>A query parameter can automatically converted to a type, if the target type matches one of the following rules:<\/p>\n<ul>\n<li>It is a primitive type<\/li>\n<li>The type has a constructor that accepts a single <code>String<\/code> argument<\/li>\n<li>The type has a static factory method named <code>valueOf()<\/code> or <code>fromString()<\/code> with a single <code>String<\/code> argument<\/li>\n<li>The type is <code>List&lt;T&gt;<\/code>, <code>Set&lt;T&gt;<\/code>; or <code>SortedSet&lt;T&gt;<\/code> where T matches one of the previous rules<\/li>\n<\/ul>\n<p>In the previous example, the query parameter <code>id<\/code> is automatically converted to <code>long<\/code>. If the <code>id<\/code> parameter is missing or a conversion to <code>long<\/code> is not possible, an exception will be thrown. It is also possible to use <code>Long<\/code> instead of <code>long<\/code>. In this case, we get <code>null<\/code> passed to the controller method if the <code>id<\/code> parameter is missing.<\/p>\n<p>Enums have a <code>valueOf()<\/code> method by default. So, the query parameter <code>role<\/code> can automatically be converted to the corresponding enum value.<\/p>\n<h2>Using <code>@QueryParam<\/code> on fields and methods<\/h2>\n<p><code>@QueryParam<\/code> is not limited to method parameters. It is also possible to map query parameters to fields or methods, like the following example shows:<\/p>\n<pre class=\" brush:java\">@Controller\r\n@Path(\"query-params-fields\")\r\npublic class QueryParamsFieldController {\r\n\r\n  @QueryParam(\"id\")\r\n  private Long id;\r\n\r\n  @QueryParam(\"role\")\r\n  private Role role;\r\n\r\n  private String name;\r\n\r\n  @QueryParam(\"name\")\r\n  public void setName(String name) {\r\n    this.name = name;\r\n  }\r\n  \r\n  @GET\r\n  public String queryParams() {\r\n    \/\/ use id, role and name\r\n  }\r\n}<\/pre>\n<p>If we now send a HTTP GET request to:<\/p>\n<pre class=\" brush:java\">\/query-params-fields?name=john&amp;id=42&amp;role=reporter<\/pre>\n<p>the parameters are set to the fields <code>id<\/code>, <code>role<\/code> and <code>name<\/code> (via <code>setName()<\/code>) before <code>queryParams()<\/code> is called.<\/p>\n<p>Do not forget that a new instance of the class is created for every request, so it is safe to have fields that contain request information.<\/p>\n<h2>Quick Summary<\/h2>\n<p>The <code>@QueryParam<\/code> annotation can be used to obtain query parameters. <code>@QueryParam<\/code> can be used on fields, methods and method parameters. Query parameters can be automatically converted to various types, as long as the target type is a primitive type, contains a String constructor or contains <code>valueOf()<\/code> or <code>fromString()<\/code> factory methods.<\/p>\n<ul>\n<li>You can find the source code for all the shown examples on <a href=\"https:\/\/github.com\/mscharhag\/java-ee-8-mvc\/tree\/master\/request-data\">GitHub<\/a>.<\/li>\n<\/ul>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/www.mscharhag.com\/java-ee-mvc\/query-parameters\">Java EE 8 MVC: Working with query parameters<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/join-us\/jcg\/\">JCG partner<\/a> Michael Scharhag at the <a href=\"http:\/\/www.mscharhag.com\/\">mscharhag, Programming and Stuff<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In the previous post about the new Java EE MVC Framework we had a detailed look on Controllers. In this and the following posts we will see how to access various types of request data in MVC Controllers. Java EE MVC makes heavy use of JAX-RS and most of the things we will see in &hellip;<\/p>\n","protected":false},"author":514,"featured_media":112,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[1048,573],"class_list":["post-51071","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-java-ee-8","tag-mvc"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java EE 8 MVC: Working with query parameters - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In the previous post about the new Java EE MVC Framework we had a detailed look on Controllers. In this and the following posts we will see how to access\" \/>\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\/2016\/01\/java-ee-8-mvc-working-query-parameters.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java EE 8 MVC: Working with query parameters - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In the previous post about the new Java EE MVC Framework we had a detailed look on Controllers. In this and the following posts we will see how to access\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.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=\"2016-01-18T08:00:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-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=\"Michael Scharhag\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/mscharhag\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Scharhag\" \/>\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\\\/2016\\\/01\\\/java-ee-8-mvc-working-query-parameters.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/java-ee-8-mvc-working-query-parameters.html\"},\"author\":{\"name\":\"Michael Scharhag\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/0f0f81e875d40e3f820392e0ffce65d1\"},\"headline\":\"Java EE 8 MVC: Working with query parameters\",\"datePublished\":\"2016-01-18T08:00:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/java-ee-8-mvc-working-query-parameters.html\"},\"wordCount\":457,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/java-ee-8-mvc-working-query-parameters.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"keywords\":[\"Java EE 8\",\"MVC\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/java-ee-8-mvc-working-query-parameters.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/java-ee-8-mvc-working-query-parameters.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/java-ee-8-mvc-working-query-parameters.html\",\"name\":\"Java EE 8 MVC: Working with query parameters - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/java-ee-8-mvc-working-query-parameters.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/java-ee-8-mvc-working-query-parameters.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2016-01-18T08:00:46+00:00\",\"description\":\"In the previous post about the new Java EE MVC Framework we had a detailed look on Controllers. In this and the following posts we will see how to access\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/java-ee-8-mvc-working-query-parameters.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/java-ee-8-mvc-working-query-parameters.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/java-ee-8-mvc-working-query-parameters.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"java-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/java-ee-8-mvc-working-query-parameters.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\":\"Java EE 8 MVC: Working with query parameters\"}]},{\"@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\\\/0f0f81e875d40e3f820392e0ffce65d1\",\"name\":\"Michael Scharhag\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/52283459bfc820fb6a66704b3eccc771a1d8a63a0bdbbe1651bb5cb383a42148?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/52283459bfc820fb6a66704b3eccc771a1d8a63a0bdbbe1651bb5cb383a42148?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/52283459bfc820fb6a66704b3eccc771a1d8a63a0bdbbe1651bb5cb383a42148?s=96&d=mm&r=g\",\"caption\":\"Michael Scharhag\"},\"description\":\"Michael Scharhag is a Java Developer, Blogger and technology enthusiast. Particularly interested in Java related technologies including Java EE, Spring, Groovy and Grails.\",\"sameAs\":[\"http:\\\/\\\/www.mscharhag.com\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/mscharhag\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/michael-scharhag\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java EE 8 MVC: Working with query parameters - Java Code Geeks","description":"In the previous post about the new Java EE MVC Framework we had a detailed look on Controllers. In this and the following posts we will see how to access","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\/2016\/01\/java-ee-8-mvc-working-query-parameters.html","og_locale":"en_US","og_type":"article","og_title":"Java EE 8 MVC: Working with query parameters - Java Code Geeks","og_description":"In the previous post about the new Java EE MVC Framework we had a detailed look on Controllers. In this and the following posts we will see how to access","og_url":"https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2016-01-18T08:00:46+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Michael Scharhag","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/mscharhag","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Michael Scharhag","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.html"},"author":{"name":"Michael Scharhag","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/0f0f81e875d40e3f820392e0ffce65d1"},"headline":"Java EE 8 MVC: Working with query parameters","datePublished":"2016-01-18T08:00:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.html"},"wordCount":457,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","keywords":["Java EE 8","MVC"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.html","url":"https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.html","name":"Java EE 8 MVC: Working with query parameters - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2016-01-18T08:00:46+00:00","description":"In the previous post about the new Java EE MVC Framework we had a detailed look on Controllers. In this and the following posts we will see how to access","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","width":150,"height":150,"caption":"java-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/java-ee-8-mvc-working-query-parameters.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":"Java EE 8 MVC: Working with query parameters"}]},{"@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\/0f0f81e875d40e3f820392e0ffce65d1","name":"Michael Scharhag","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/52283459bfc820fb6a66704b3eccc771a1d8a63a0bdbbe1651bb5cb383a42148?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/52283459bfc820fb6a66704b3eccc771a1d8a63a0bdbbe1651bb5cb383a42148?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/52283459bfc820fb6a66704b3eccc771a1d8a63a0bdbbe1651bb5cb383a42148?s=96&d=mm&r=g","caption":"Michael Scharhag"},"description":"Michael Scharhag is a Java Developer, Blogger and technology enthusiast. Particularly interested in Java related technologies including Java EE, Spring, Groovy and Grails.","sameAs":["http:\/\/www.mscharhag.com\/","https:\/\/x.com\/https:\/\/twitter.com\/mscharhag"],"url":"https:\/\/www.javacodegeeks.com\/author\/michael-scharhag"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/51071","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\/514"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=51071"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/51071\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=51071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=51071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=51071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}