{"id":45,"date":"2018-08-02T01:51:43","date_gmt":"2018-08-02T01:51:43","guid":{"rendered":"http:\/\/blog.supol.cz\/?p=45"},"modified":"2023-10-02T13:30:08","modified_gmt":"2023-10-02T13:30:08","slug":"introduction-of-jersey-to-the-eclipse-community","status":"publish","type":"post","link":"https:\/\/blog.supol.cz\/?p=45","title":{"rendered":"Introducing Jersey to the Eclipse Community"},"content":{"rendered":"<p>Most of the Java EE projects have already <a href=\"http:\/\/blog.supol.cz\/?p=5\">transitioned to the Eclipse Foundation<\/a> under the <a href=\"https:\/\/jakarta.ee\/\">Jakarta EE<\/a> umbrella of projects. One of those projects is Jersey, which is a RESTful Web services framework and reference implementation of the <a href=\"https:\/\/jcp.org\/en\/jsr\/detail?id=370\">JAX-RS Specification<\/a>. <a href=\"http:\/\/blog.supol.cz\/?p=36\">We announced<\/a>\u00a0the initial contribution of Jersey a few weeks ago. Since then, we saw an increase of community interest in Jersey. We registered a number of filed ideas for enhancements, discovered issues, and received pull requests from both individuals and industry. All of these are very welcome.<\/p>\n<p>Jersey is used in <a href=\"https:\/\/projects.eclipse.org\/projects\/ee4j.glassfish\">Glassfish<\/a> and Weblogic application servers, and it is often understood to be an &#8220;enterprise&#8221; framework that needs a full application server with CDI, <a href=\"https:\/\/projects.eclipse.org\/projects\/ee4j.ejb\">EJB<\/a>, and bean validation support, or at least a <a href=\"https:\/\/projects.eclipse.org\/projects\/ee4j.servlet\">servlet<\/a> container, such as Tomcat. Sure, Jersey can leverage integration with other Java EE\/<a href=\"https:\/\/projects.eclipse.org\/projects\/ee4j\">Jakarta EE projects<\/a>, but there is more.\u00a0 Jersey comes with the ability to deploy JAX-RS applications in a Java SE environment; it provides a container extension module that enables support for using a variety of frameworks that only understand the HTTP protocol. This is useful in the microservices world. Using Jersey, you can create a simple micro application that is capable of running inside a Docker container with just a JDK installed!<\/p>\n<p>Let&#8217;s create an application that accepts queries and provides answers. First, we define the maven dependencies. Note the last hk2 dependency which is needed since Jersey 2.26:<\/p>\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"&lt;dependency&gt;\n    &lt;groupId&gt;org.glassfish.jersey.core&lt;\/groupId&gt;\n    &lt;artifactId&gt;jersey-common&lt;\/artifactId&gt;\n&lt;\/dependency&gt;\n&lt;dependency&gt;\n    &lt;groupId&gt;org.glassfish.jersey.core&lt;\/groupId&gt;\n    &lt;artifactId&gt;jersey-client&lt;\/artifactId&gt;\n&lt;\/dependency&gt;\n&lt;dependency&gt;\n    &lt;groupId&gt;org.glassfish.jersey.core&lt;\/groupId&gt;\n    &lt;artifactId&gt;jersey-server&lt;\/artifactId&gt;\n&lt;\/dependency&gt;\n&lt;dependency&gt;\n    &lt;groupId&gt;org.glassfish.jersey.inject&lt;\/groupId&gt;\n    &lt;artifactId&gt;jersey-hk2&lt;\/artifactId&gt;\n&lt;\/dependency&gt;\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\">\n\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:650px;\"><div class=\"text codecolorer\">&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;dependency&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;groupId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;org.glassfish.jersey.core&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;groupId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;artifactId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;jersey-common&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;artifactId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;dependency&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;dependency&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;groupId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;org.glassfish.jersey.core&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;groupId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;artifactId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;jersey-client&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;artifactId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;dependency&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;dependency&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;groupId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;org.glassfish.jersey.core&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;groupId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;artifactId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;jersey-server&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;artifactId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;dependency&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;dependency&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;groupId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;org.glassfish.jersey.inject&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;groupId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;artifactId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;jersey-hk2&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;artifactId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;dependency&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<\/div><\/div>\n\n<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">For simplicity, we can use the HTTP server from the JDK so as not to bring other dependencies, such as the widely used <a href=\"https:\/\/projects.eclipse.org\/projects\/ee4j.grizzly\">Grizzly<\/a>. (Other <a href=\"https:\/\/jersey.github.io\/documentation\/latest\/deployment.html#deployment.javase\">deployment options<\/a> are described in the <a href=\"https:\/\/jersey.github.io\/documentation\/latest\/index.html\">Jersey User Guide<\/a>, which has yet to be transitioned to the Eclipse Foundation):<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"&lt;dependency&gt;\n    &lt;groupId&gt;org.glassfish.jersey.containers&lt;\/groupId&gt;\n    &lt;artifactId&gt;jersey-container-jdk-http&lt;\/artifactId&gt;\n&lt;\/dependency&gt;\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\">\n\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:650px;\"><div class=\"text codecolorer\">&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;dependency&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;groupId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;org.glassfish.jersey.containers&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;groupId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;artifactId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;jersey-container-jdk-http&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;artifactId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;dependency&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<\/div><\/div>\n\n<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">We would like to send popular JSON, so we added a dependency for it:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"&lt;dependency&gt;\n    &lt;groupId&gt;org.glassfish.jersey.media&lt;\/groupId&gt;\n    &lt;artifactId&gt;jersey-media-json-binding&lt;\/artifactId&gt;\n&lt;\/dependency&gt;\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\">\n\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:650px;\"><div class=\"text codecolorer\">&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;dependency&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;groupId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;org.glassfish.jersey.media&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;groupId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;artifactId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;jersey-media-json-binding&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;artifactId&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;lt;\/&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;dependency&lt;\/span&gt;&lt;span style=&quot;color: #93A1A1&quot;&gt;&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<\/div><\/div>\n\n<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">We define the entity to be sent as an answer and the resource that sends responses for the <a href=\"http:\/\/hitchhikers.wikia.com\/wiki\/Ultimate_Question\">ultimate question<\/a> requests:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"public class Answer {\n    public Answer(String answer) {\n    this.answer = answer;\n    }\n    public String answer;\n}\n\n@Path(&quot;\/question&quot;)\npublic class QuestionResource {\n    public static final String RESPONSE = &quot;42&quot;;\n    \n    @GET\n    @Path(&quot;ultimate&quot;)\n    @Produces(MediaType.APPLICATION_JSON)\n    public Answer getResponse() {\n        return new Answer(RESPONSE);\n    }\n}\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\">\n\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:650px;\"><div class=\"text codecolorer\">&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;public&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;class&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #CB4B16&quot;&gt;Answer&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; {&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;public&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;Answer&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;(&lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;String&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; answer) {&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;this&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;.&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;answer&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #859900&quot;&gt;=&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; answer;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;}&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;public&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;String&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;answer&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt;}&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt;@&lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;Path&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;(&lt;\/span&gt;&lt;span style=&quot;color: #2AA198&quot;&gt;&amp;quot;\/question&amp;quot;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;)&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;public&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;class&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #CB4B16&quot;&gt;QuestionResource&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; {&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;public&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;static&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;final&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;String&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;RESPONSE&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #859900&quot;&gt;=&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #2AA198&quot;&gt;&amp;quot;42&amp;quot;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;@&lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;GET&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;@&lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;Path&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;(&lt;\/span&gt;&lt;span style=&quot;color: #2AA198&quot;&gt;&amp;quot;ultimate&amp;quot;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;)&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;@&lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;Produces&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;(&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;MediaType&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;.&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;APPLICATION_JSON&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;)&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;public&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;Answer&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;getResponse&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;() {&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/span&gt;&lt;span style=&quot;color: #859900&quot;&gt;return&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #859900&quot;&gt;new&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;Answer&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;(RESPONSE);&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &nbsp; &nbsp;}&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt;}&lt;\/span&gt;&lt;\/span&gt;<\/div><\/div>\n\n<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">We start the JDK HTTP Server on port 8080 with the <em>QuestionResource<\/em> registered. We also want the entity to be wired as JSON, so we use <em>JsonBindingFeature<\/em>:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"URI base_uri = UriBuilder.fromUri(&quot;http:\/\/localhost\/&quot;).port(8080).build();\nResourceConfig config = new ResourceConfig(QuestionResource.class, JsonBindingFeature.class);\nJdkHttpServerFactory.createHttpServer(base_uri, config);\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\">\n\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:650px;\"><div class=\"text codecolorer\">&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;URI&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;base_uri&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #859900&quot;&gt;=&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;UriBuilder&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;.&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;fromUri&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;(&lt;\/span&gt;&lt;span style=&quot;color: #2AA198&quot;&gt;&amp;quot;http:\/\/localhost\/&amp;quot;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;).&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;port&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;(&lt;\/span&gt;&lt;span style=&quot;color: #D33682&quot;&gt;8080&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;).&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;build&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;();&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #586E75; font-weight: bold&quot;&gt;ResourceConfig&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;config&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #859900&quot;&gt;=&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #859900&quot;&gt;new&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt; &lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;ResourceConfig&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;(&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;QuestionResource&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;.&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;class&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;, &lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;JsonBindingFeature&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;.&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;class&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;);&lt;\/span&gt;&lt;\/span&gt;<br \/>\n&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;JdkHttpServerFactory&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;.&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;createHttpServer&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;(base_uri, config);&lt;\/span&gt;&lt;\/span&gt;<\/div><\/div>\n\n<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">At this point, the Jersey application is up. We can use cURL, or even better, the JAX-RS Client (implemented by Jersey of course &#8211; and we have defined the maven <em>org.glassfish.jersey.core:jersey-client<\/em> dependency for it already):<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"System.out.println(ClientBuilder.newClient().target(base_uri).path(&quot;question\/ultimate&quot;).request().get(String.class));\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\">\n\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:650px;\"><div class=\"text codecolorer\">&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;System&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;.&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;out&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;.&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;println&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;(&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;ClientBuilder&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;.&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;newClient&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;().&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;target&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;(base_uri).&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;path&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;(&lt;\/span&gt;&lt;span style=&quot;color: #2AA198&quot;&gt;&amp;quot;question\/ultimate&amp;quot;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;).&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;request&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;().&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;get&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;(&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;String&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;.&lt;\/span&gt;&lt;span style=&quot;color: #268BD2&quot;&gt;class&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;));&lt;\/span&gt;&lt;\/span&gt;<\/div><\/div>\n\n<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">And we should see the JSON response:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"{&quot;answer&quot;:&quot;42&quot;}\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\">\n\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:650px;\"><div class=\"text codecolorer\">&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color: #657B83&quot;&gt;{&lt;\/span&gt;&lt;span style=&quot;color: #859900&quot;&gt;&amp;quot;answer&amp;quot;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;:&lt;\/span&gt;&lt;span style=&quot;color: #2AA198&quot;&gt;&amp;quot;42&amp;quot;&lt;\/span&gt;&lt;span style=&quot;color: #657B83&quot;&gt;}&lt;\/span&gt;&lt;\/span&gt;<\/div><\/div>\n\n<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The ability to run the JAX-RS application in the Java SE environment is a new feature in the planned <a href=\"https:\/\/projects.eclipse.org\/projects\/ee4j.jaxrs\">JAX-RS<\/a> 2.2 release.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">JAX-RS is evolving fast. There are already plans for 3.0, which Jersey needs to reflect. Also, there are <a href=\"https:\/\/projects.eclipse.org\/proposals\/eclipse-microprofile\">MicroProfile<\/a> features that Jersey should either implement or integrate with. And JDK 9\/10\/11 needs to be fully supported. There is a lot of work for the future and we are looking forward to hearing from the community. Your <a href=\"https:\/\/github.com\/eclipse-ee4j\/jersey\">feature proposals, bug reports, and pull requests<\/a> are very much appreciated!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most of the Java EE projects have already transitioned to the Eclipse Foundation under the Jakarta EE umbrella of projects. One of those projects is Jersey, which is a RESTful Web services framework and reference implementation of the JAX-RS Specification. &hellip; <a href=\"https:\/\/blog.supol.cz\/?p=45\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-45","post","type-post","status-publish","format-standard","hentry","category-jersey"],"_links":{"self":[{"href":"https:\/\/blog.supol.cz\/index.php?rest_route=\/wp\/v2\/posts\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.supol.cz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.supol.cz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.supol.cz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.supol.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=45"}],"version-history":[{"count":48,"href":"https:\/\/blog.supol.cz\/index.php?rest_route=\/wp\/v2\/posts\/45\/revisions"}],"predecessor-version":[{"id":310,"href":"https:\/\/blog.supol.cz\/index.php?rest_route=\/wp\/v2\/posts\/45\/revisions\/310"}],"wp:attachment":[{"href":"https:\/\/blog.supol.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.supol.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.supol.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}