{"id":986,"date":"2023-01-27T17:24:07","date_gmt":"2023-09-18T22:56:34","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/java%e3%81%ab%e3%82%88%e3%82%8brestful-web%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/"},"modified":"2025-08-01T04:03:56","modified_gmt":"2025-07-31T19:03:56","slug":"java%e3%81%ab%e3%82%88%e3%82%8brestful-web%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%82%88%e3%82%8brestful-web%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/","title":{"rendered":"Java\u306b\u3088\u308bRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb"},"content":{"rendered":"<p>Java\u3067\u306eRestful Web\u30b5\u30fc\u30d3\u30b9\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3078\u3088\u3046\u3053\u305d\u3002REST\u306fREpresentational State Transfer\u306e\u7565\u3067\u3059\u3002REST\u306f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u901a\u3058\u3066\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u305f\u3081\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u30b9\u30bf\u30a4\u30eb\u3067\u3059\u3002REST\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u30b9\u30bf\u30a4\u30eb\u306f\u30012000\u5e74\u306b\u30ed\u30a4\u30fb\u30d5\u30a3\u30fc\u30eb\u30c7\u30a3\u30f3\u30b0\u304c\u5f7c\u306e\u535a\u58eb\u8ad6\u6587\u3067\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n<h2>\u5b89\u3089\u304b\u306a\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9<\/h2>\n<p>\u30ec\u30b9\u30c8\u30d5\u30eb\u306a\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u306f\u3001\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u304c\u30ea\u30bd\u30fc\u30b9\u3068\u3057\u3066\u8b58\u5225\u3055\u308c\u3001\u305d\u308c\u305e\u308c\u306eURI\u306b\u3088\u3063\u3066\u30a2\u30af\u30bb\u30b9\u3055\u308c\u308b\u72b6\u614b\u3092\u6301\u305f\u306a\u3044\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b5\u30fc\u30d0\u30fc\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3067\u3059\u3002\u30ec\u30b9\u30c8\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u3001HTTP\u306eGET\/POST\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30ec\u30b9\u30c8\u30d5\u30eb\u306a\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30ec\u30b9\u30c8\u306f\u4f7f\u7528\u3059\u308b\u7279\u5b9a\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u307b\u3068\u3093\u3069\u306e\u5834\u5408\u3001HTTP\/HTTPS\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002SOAP\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u3068\u6bd4\u8f03\u3059\u308b\u3068\u3001\u3053\u308c\u3089\u306f\u8efd\u91cf\u3067\u3001\u6a19\u6e96\u306b\u5f93\u3063\u3066\u3044\u307e\u305b\u3093\u3002\u30ea\u30af\u30a8\u30b9\u30c8\u3068\u30ec\u30b9\u30dd\u30f3\u30b9\u306b\u306fXML\u3001JSON\u3001\u30c6\u30ad\u30b9\u30c8\u3084\u305d\u306e\u4ed6\u306e\u30c7\u30fc\u30bf\u5f62\u5f0f\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>Java\u306eRESTful\u306aWeb\u30b5\u30fc\u30d3\u30b9API<\/h3>\n<p>RESTful Web\u30b5\u30fc\u30d3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306eJava API\uff08JAX-RS\uff09\u306f\u3001Web\u30b5\u30fc\u30d3\u30b9\u306e\u958b\u767a\u3068\u5c55\u958b\u3092\u7c21\u7d20\u5316\u3059\u308b\u305f\u3081\u306b\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002JAX-RS\u306fJDK\u306e\u4e00\u90e8\u306a\u306e\u3067\u3001\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u4f55\u3082\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<h3>\u30ec\u30b9\u30c8\u30d5\u30eb\u306a\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3<\/h3>\n<p>\u3044\u304f\u3064\u304b\u306e\u91cd\u8981\u306aJAX-RS\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>@Path: used to specify the relative path of class and methods. We can get the URI of a webservice by scanning the Path annotation value.<\/li>\n<li>@GET, @PUT, @POST, @DELETE and @HEAD: used to specify the HTTP request type for a method.<\/li>\n<li>@Produces, @Consumes: used to specify the request and response types.<\/li>\n<li>@PathParam: used to bind the method parameter to path value by parsing it.<\/li>\n<\/ul>\n<h3>\u30ec\u30b9\u30c8\u30d5\u30eb\u306a\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u3068SOAP<\/h3>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>SOAP\u306f\u30d7\u30ed\u30c8\u30b3\u30eb\u3067\u3042\u308a\u3001REST\u306f\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306e\u30b9\u30bf\u30a4\u30eb\u3067\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>SOAP\u306e\u30b5\u30fc\u30d0\u30fc\u3068\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306fWSDL\u5951\u7d04\u306b\u3088\u3063\u3066\u5bc6\u63a5\u306b\u7d50\u3073\u3064\u3044\u3066\u3044\u307e\u3059\u304c\u3001REST\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u3068\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u306f\u5951\u7d04\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>SOAP\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u3068\u6bd4\u8f03\u3059\u308b\u3068\u3001REST\u306e\u5b66\u7fd2\u66f2\u7dda\u306f\u7c21\u5358\u3067\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>REST\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3068\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u30bf\u30a4\u30d7\u306fXML\u3001JSON\u3001\u30c6\u30ad\u30b9\u30c8\u306a\u3069\u3067\u3059\u304c\u3001SOAP\u306fXML\u306e\u307f\u3067\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>JAX-RS\u306fREST\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u306e\u305f\u3081\u306eJava API\u3067\u3001JAX-WS\u306fSOAP\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u306e\u305f\u3081\u306eJava API\u3067\u3059\u3002<\/ol>\n<h3>REST API\u306e\u5b9f\u88c5<\/h3>\n<p>JAX-RS API\u306b\u306f\u30012\u3064\u306e\u4e3b\u8981\u306a\u5b9f\u88c5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Jersey: \u30b8\u30e3\u30fc\u30b8\u306f\u30b5\u30f3\u304c\u63d0\u4f9b\u3059\u308b\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u5b9f\u88c5\u3067\u3059\u3002JAX-RS\u306e\u5b9f\u88c5\u3068\u3057\u3066Jersey\u3092\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001web.xml\u3067\u305d\u306e\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u3092\u8a2d\u5b9a\u3057\u3001\u5fc5\u8981\u306a\u4f9d\u5b58\u95a2\u4fc2\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u306a\u304a\u3001JAX-RS API\u306fJersey\u3067\u306f\u306a\u304fJDK\u306e\u4e00\u90e8\u3067\u3042\u308b\u305f\u3081\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u305d\u306e\u4f9d\u5b58\u95a2\u4fc2\u306eJAR\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>RESTEasy: RESTEasy\u306fJAX-RS\u306e\u5b9f\u88c5\u3092\u63d0\u4f9b\u3059\u308bJBoss\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002<\/ol>\n<h3>Java\u306eRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/h3>\n<p>Jersey\u3068RESTEasy\u3092\u4f7f\u7528\u3057\u3066\u3001\u3069\u308c\u304f\u3089\u3044\u7c21\u5358\u306bRestful Web\u30b5\u30fc\u30d3\u30b9\u3092\u4f5c\u6210\u3067\u304d\u308b\u304b\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002HTTP\u3092\u4ecb\u3057\u3066\u4ee5\u4e0b\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u516c\u958b\u3057\u3001Chrome Postman\u62e1\u5f35\u6a5f\u80fd\u3092\u4f7f\u7528\u3057\u3066\u3053\u308c\u3089\u3092\u30c6\u30b9\u30c8\u3057\u307e\u3059\u3002<\/p>\n<div>\n<div class=\"post-table\">\n<table>\n<thead>\n<tr>\n<th>URI<\/th>\n<th>HTTP Method<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\/person\/{id}\/getDummy<\/td>\n<td>GET<\/td>\n<td>Returns a dummy person object<\/td>\n<\/tr>\n<tr>\n<td>\/person\/add<\/td>\n<td>POST<\/td>\n<td>Adds a person<\/td>\n<\/tr>\n<tr>\n<td>\/person\/{id}\/delete<\/td>\n<td>GET<\/td>\n<td>Delete the person with \u2018id\u2019 in the URI<\/td>\n<\/tr>\n<tr>\n<td>\/person\/getAll<\/td>\n<td>GET<\/td>\n<td>Get all persons<\/td>\n<\/tr>\n<tr>\n<td>\/person\/{id}\/get<\/td>\n<td>GET<\/td>\n<td>Get the person with \u2018id\u2019 in the URI<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>Jersey\u306eRestful Web\u30b5\u30fc\u30d3\u30b9<\/h3>\n<p>\u52d5\u7684\u306a\u30a6\u30a7\u30d6\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3001\u305d\u308c\u3092Maven\u306b\u5909\u63db\u3057\u3066\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u9aa8\u7d44\u307f\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\u4e0b\u306e\u753b\u50cf\u306f\u6700\u7d42\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u69cb\u9020\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002pom.xml\u30d5\u30a1\u30a4\u30eb\u306b\u306f\u3001Jersey\u306e\u4f9d\u5b58\u95a2\u4fc2\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;project xmlns=\"https:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"https:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:schemaLocation=\"https:\/\/maven.apache.org\/POM\/4.0.0 https:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"&gt;\r\n  &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n  &lt;groupId&gt;JAXRS-Example&lt;\/groupId&gt;\r\n  &lt;artifactId&gt;JAXRS-Example&lt;\/artifactId&gt;\r\n  &lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\r\n  &lt;packaging&gt;war&lt;\/packaging&gt;\r\n  \r\n  &lt;dependencies&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;com.sun.jersey&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;jersey-server&lt;\/artifactId&gt;\r\n            &lt;version&gt;1.19&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;com.sun.jersey&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;jersey-servlet&lt;\/artifactId&gt;\r\n            &lt;version&gt;1.19&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;com.sun.jersey&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;jersey-client&lt;\/artifactId&gt;\r\n            &lt;version&gt;1.19&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n  &lt;\/dependencies&gt;\r\n  \r\n  &lt;build&gt;\r\n    &lt;sourceDirectory&gt;src&lt;\/sourceDirectory&gt;\r\n    &lt;plugins&gt;\r\n      &lt;plugin&gt;\r\n        &lt;artifactId&gt;maven-war-plugin&lt;\/artifactId&gt;\r\n        &lt;version&gt;2.6&lt;\/version&gt;\r\n        &lt;configuration&gt;\r\n          &lt;warSourceDirectory&gt;WebContent&lt;\/warSourceDirectory&gt;\r\n          &lt;failOnMissingWebXml&gt;false&lt;\/failOnMissingWebXml&gt;\r\n        &lt;\/configuration&gt;\r\n      &lt;\/plugin&gt;\r\n      &lt;plugin&gt;\r\n        &lt;artifactId&gt;maven-compiler-plugin&lt;\/artifactId&gt;\r\n        &lt;version&gt;3.3&lt;\/version&gt;\r\n        &lt;configuration&gt;\r\n          &lt;source&gt;1.7&lt;\/source&gt;\r\n          &lt;target&gt;1.7&lt;\/target&gt;\r\n        &lt;\/configuration&gt;\r\n      &lt;\/plugin&gt;\r\n    &lt;\/plugins&gt;\r\n  &lt;\/build&gt;\r\n&lt;\/project&gt;\r\n<\/code><\/pre>\n<p>\u30b8\u30e3\u30fc\u30b8\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001Jersey\u3092\u4f7f\u7528\u3057\u3066REST\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u3092\u547c\u3073\u51fa\u3059Java\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3044\u3066\u3044\u308b\u5834\u5408\u306f\u5fc5\u8981\u3067\u3059\u3002\u6b21\u306b\u3001\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u8a18\u8ff0\u5b50\u3092\u898b\u3066\u3001Jersey\u3092\u8a2d\u5b9a\u3057\u3066\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u3092\u5b66\u3073\u307e\u3057\u3087\u3046\u3002<\/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\" 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;JAXRS-Example&lt;\/display-name&gt;\r\n\r\n&lt;!-- Jersey Servlet configurations --&gt;\r\n    &lt;servlet&gt;\r\n    &lt;servlet-name&gt;Jersey REST Service&lt;\/servlet-name&gt;\r\n    &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;\/servlet-class&gt;\r\n    &lt;init-param&gt;\r\n      &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;\/param-name&gt;\r\n      &lt;param-value&gt;com.scdev&lt;\/param-value&gt;\r\n    &lt;\/init-param&gt;\r\n    &lt;load-on-startup&gt;1&lt;\/load-on-startup&gt;\r\n  &lt;\/servlet&gt;\r\n  &lt;servlet-mapping&gt;\r\n    &lt;servlet-name&gt;Jersey REST Service&lt;\/servlet-name&gt;\r\n    &lt;url-pattern&gt;\/*&lt;\/url-pattern&gt;\r\n  &lt;\/servlet-mapping&gt;\r\n  &lt;!-- Jersey Servlet configurations --&gt;\r\n\r\n&lt;\/web-app&gt;\r\n<\/code><\/pre>\n<p>\u79c1\u305f\u3061\u306eWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306bJersey\u3092\u30d7\u30e9\u30b0\u30a4\u30f3\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u3053\u3068\u306f\u4ee5\u4e0a\u3067\u3059\u3002Java\u306e\u30b3\u30fc\u30c9\u3067\u306fJAX-RS\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002init\u30d1\u30e9\u30e1\u30fc\u30bfcom.sun.jersey.config.property.packages\u306e\u5024\u306b\u306f\u3001Web\u30b5\u30fc\u30d3\u30b9\u306e\u30ea\u30bd\u30fc\u30b9\u3068\u30e1\u30bd\u30c3\u30c9\u304c\u30b9\u30ad\u30e3\u30f3\u3055\u308c\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\u30e2\u30c7\u30eb\u306e\u30af\u30e9\u30b9\u306eREST\u306e\u4f8b<\/h3>\n<p>\u307e\u305a\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c7\u30fc\u30bf\u7528\u306bPerson\u3068\u3044\u3046\u30e2\u30c7\u30eb\u30d3\u30fc\u30f3\u3068\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b7\u30b9\u30c6\u30e0\u3078\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u9001\u4fe1\u7528\u306bResponse\u3068\u3044\u3046\u30e2\u30c7\u30eb\u30d3\u30fc\u30f3\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002XML\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u9001\u4fe1\u3059\u308b\u305f\u3081\u3001\u3053\u308c\u3089\u306e\u30d3\u30fc\u30f3\u306b\u306f@XmlRootElement\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u3053\u306e\u30af\u30e9\u30b9\u304c\u5b58\u5728\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.jaxrs.model;\r\n\r\nimport javax.xml.bind.annotation.XmlRootElement;\r\n\r\n@XmlRootElement (name=\"person\")\r\npublic class Person {\r\n\tprivate String name;\r\n\tprivate int age;\r\n\tprivate int id;\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\r\n\tpublic int getAge() {\r\n\t\treturn age;\r\n\t}\r\n\r\n\tpublic void setAge(int age) {\r\n\t\tthis.age = age;\r\n\t}\r\n\r\n\tpublic int getId() {\r\n\t\treturn id;\r\n\t}\r\n\r\n\tpublic void setId(int id) {\r\n\t\tthis.id = id;\r\n\t}\r\n\t\r\n\t@Override\r\n\tpublic String toString(){\r\n\t\treturn id+\"::\"+name+\"::\"+age;\r\n\t}\r\n\r\n}\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>package com.scdev.jaxrs.model;\r\n\r\nimport javax.xml.bind.annotation.XmlRootElement;\r\n\r\n@XmlRootElement\r\npublic class Response {\r\n\r\n\tprivate boolean status;\r\n\tprivate String message;\r\n\r\n\tpublic boolean isStatus() {\r\n\t\treturn status;\r\n\t}\r\n\r\n\tpublic void setStatus(boolean status) {\r\n\t\tthis.status = status;\r\n\t}\r\n\r\n\tpublic String getMessage() {\r\n\t\treturn message;\r\n\t}\r\n\r\n\tpublic void setMessage(String message) {\r\n\t\tthis.message = message;\r\n\t}\r\n}\r\n<\/code><\/pre>\n<h3>REST\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u30b5\u30fc\u30d3\u30b9<\/h3>\n<p>\u79c1\u305f\u3061\u306eURI\u306e\u69cb\u9020\u306b\u57fa\u3065\u3044\u3066\u3001\u4ee5\u4e0b\u306f\u30b5\u30fc\u30d3\u30b9\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3068\u305d\u306e\u5b9f\u88c5\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.jaxrs.service;\r\n\r\nimport com.scdev.jaxrs.model.Person;\r\nimport com.scdev.jaxrs.model.Response;\r\n\r\npublic interface PersonService {\r\n\r\n\tpublic Response addPerson(Person p);\r\n\t\r\n\tpublic Response deletePerson(int id);\r\n\t\r\n\tpublic Person getPerson(int id);\r\n\t\r\n\tpublic Person[] getAllPersons();\r\n\r\n}\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>package com.scdev.jaxrs.service;\r\n\r\n\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\nimport java.util.Set;\r\n\r\nimport javax.ws.rs.Consumes;\r\nimport javax.ws.rs.GET;\r\nimport javax.ws.rs.POST;\r\nimport javax.ws.rs.Path;\r\nimport javax.ws.rs.PathParam;\r\nimport javax.ws.rs.Produces;\r\nimport javax.ws.rs.core.MediaType;\r\n\r\nimport com.scdev.jaxrs.model.Person;\r\nimport com.scdev.jaxrs.model.Response;\r\n\r\n@Path(\"\/person\")\r\n@Consumes(MediaType.APPLICATION_XML)\r\n@Produces(MediaType.APPLICATION_XML)\r\npublic class PersonServiceImpl implements PersonService {\r\n\r\n\tprivate static Map&lt;Integer,Person&gt; persons = new HashMap&lt;Integer,Person&gt;();\r\n\t\r\n\t@Override\r\n\t@POST\r\n    @Path(\"\/add\")\r\n\tpublic Response addPerson(Person p) {\r\n\t\tResponse response = new Response();\r\n\t\tif(persons.get(p.getId()) != null){\r\n\t\t\tresponse.setStatus(false);\r\n\t\t\tresponse.setMessage(\"Person Already Exists\");\r\n\t\t\treturn response;\r\n\t\t}\r\n\t\tpersons.put(p.getId(), p);\r\n\t\tresponse.setStatus(true);\r\n\t\tresponse.setMessage(\"Person created successfully\");\r\n\t\treturn response;\r\n\t}\r\n\r\n\t@Override\r\n\t@GET\r\n    @Path(\"\/{id}\/delete\")\r\n\tpublic Response deletePerson(@PathParam(\"id\") int id) {\r\n\t\tResponse response = new Response();\r\n\t\tif(persons.get(id) == null){\r\n\t\t\tresponse.setStatus(false);\r\n\t\t\tresponse.setMessage(\"Person Doesn't Exists\");\r\n\t\t\treturn response;\r\n\t\t}\r\n\t\tpersons.remove(id);\r\n\t\tresponse.setStatus(true);\r\n\t\tresponse.setMessage(\"Person deleted successfully\");\r\n\t\treturn response;\r\n\t}\r\n\r\n\t@Override\r\n\t@GET\r\n\t@Path(\"\/{id}\/get\")\r\n\tpublic Person getPerson(@PathParam(\"id\") int id) {\r\n\t\treturn persons.get(id);\r\n\t}\r\n\t\r\n\t@GET\r\n\t@Path(\"\/{id}\/getDummy\")\r\n\tpublic Person getDummyPerson(@PathParam(\"id\") int id) {\r\n\t\tPerson p = new Person();\r\n\t\tp.setAge(99);\r\n\t\tp.setName(\"Dummy\");\r\n\t\tp.setId(id);\r\n\t\treturn p;\r\n\t}\r\n\r\n\t@Override\r\n\t@GET\r\n\t@Path(\"\/getAll\")\r\n\tpublic Person[] getAllPersons() {\r\n\t\tSet&lt;Integer&gt; ids = persons.keySet();\r\n\t\tPerson[] p = new Person[ids.size()];\r\n\t\tint i=0;\r\n\t\tfor(Integer id : ids){\r\n\t\t\tp[i] = persons.get(id);\r\n\t\t\ti++;\r\n\t\t}\r\n\t\treturn p;\r\n\t}\r\n\r\n}\r\n<\/code><\/pre>\n<p>\u307b\u3068\u3093\u3069\u306e\u30b3\u30fc\u30c9\u306f\u81ea\u5df1\u89e3\u660e\u7684\u3067\u3059\u306e\u3067\u3001JAX-RS\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\uff08@Path\u3001@PathParam\u3001@POST\u3001@GET\u3001@Consumes\u3001@Produces\uff09\u306b\u6163\u308c\u308b\u305f\u3081\u306b\u6642\u9593\u3092\u304b\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\u30ec\u30b9\u30c8\u30d5\u30eb\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u306e\u30c6\u30b9\u30c8<\/h3>\n<p>\u305d\u308c\u3067\u7d42\u308f\u308a\u3067\u3059\u3002\u79c1\u305f\u3061\u306e\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u306f\u6e96\u5099\u304c\u3067\u304d\u3066\u3044\u307e\u3059\u306e\u3067\u3001WAR\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3057\u3066Tomcat\u306ewebapps\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u914d\u7f6e\u3059\u308b\u304b\u3001\u9078\u629e\u3057\u305f\u4ed6\u306e\u30b3\u30f3\u30c6\u30ca\u306b\u30c7\u30d7\u30ed\u30a4\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4ee5\u4e0b\u306f\u3001\u3053\u306e\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u306e\u30c6\u30b9\u30c8\u306e\u4e00\u90e8\u3067\u3059\u3002\u306a\u304a\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u30d8\u30c3\u30c0\u30fc\u306bAccept\u3068Content-Type\u306e\u5024\u3092\u300capplication\/xml\u300d\u3068\u3057\u3066\u63d0\u4f9b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044 (\u4e0b\u306e\u753b\u50cf\u306b\u793a\u3059\u3088\u3046\u306b)\u3002<\/p>\n<ul class=\"post-ul\">\n<li>getDummy<\/li>\n<li>add<\/li>\n<li>get<\/li>\n<li>getAll<\/li>\n<li>delete<\/li>\n<\/ul>\n<p>Jersey JAX-RS\u306e\u5b9f\u88c5\u3092\u4f7f\u7528\u3057\u3066\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u306e\u306f\u4ee5\u4e0a\u3067\u3059\u3002\u304a\u5206\u304b\u308a\u3044\u305f\u3060\u3051\u308b\u3088\u3046\u306b\u3001\u307b\u3068\u3093\u3069\u306e\u30b3\u30fc\u30c9\u306fJAX-RS\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3001Jersey\u306f\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u8a18\u8ff0\u5b50\u3068\u4f9d\u5b58\u95a2\u4fc2\u3092\u901a\u3058\u3066\u30d7\u30e9\u30b0\u30a4\u30f3\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>RESTEasy\u306eRESTful Web\u30b5\u30fc\u30d3\u30b9\u306e\u4f8b<\/h3>\n<p>\u30b8\u30e3\u30fc\u30b8\u30fc\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u958b\u767a\u3055\u308c\u305f\u3059\u3079\u3066\u306e\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u3092\u4f7f\u7528\u3059\u308b\u4e88\u5b9a\u3067\u3059\u304c\u3001\u540c\u3058\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u5909\u66f4\u3092\u52a0\u3048\u308b\u4ee3\u308f\u308a\u306b\u3001\u65b0\u3057\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\u52d5\u7684\u306a\u30a6\u30a7\u30d6\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3001\u305d\u308c\u3092Maven\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u5909\u63db\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u305d\u3057\u3066\u3001Java\u30af\u30e9\u30b9\u3067\u3042\u308bPerson\u3001Response\u3001PersonService\u3001PersonServiceImpl\u3092\u3059\u3079\u3066\u30b3\u30d4\u30fc\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4ee5\u4e0b\u306f\u3001\u3059\u3079\u3066\u306e\u5909\u66f4\u304c\u5b8c\u4e86\u3057\u305f\u5f8c\u306e\u6700\u7d42\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002pom.xml\u30d5\u30a1\u30a4\u30eb\u306b\u4ee5\u4e0b\u306eRESTEasy\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;dependency&gt;\r\n\t&lt;groupId&gt;org.jboss.resteasy&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;resteasy-jaxrs&lt;\/artifactId&gt;\r\n\t&lt;version&gt;3.0.13.Final&lt;\/version&gt;\r\n&lt;\/dependency&gt;\r\n&lt;dependency&gt;\r\n\t&lt;groupId&gt;org.jboss.resteasy&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;resteasy-jaxb-provider&lt;\/artifactId&gt;\r\n\t&lt;version&gt;3.0.13.Final&lt;\/version&gt;\r\n&lt;\/dependency&gt;\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306f\u3001Resteasy\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u308bweb.xml\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/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\" 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;JAXRS-Example-RestEasy&lt;\/display-name&gt;\r\n     \r\n    &lt;listener&gt;\r\n      &lt;listener-class&gt;\r\n         org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap\r\n      &lt;\/listener-class&gt;\r\n   \t&lt;\/listener&gt;\r\n   \r\n    &lt;servlet&gt;\r\n        &lt;servlet-name&gt;resteasy-servlet&lt;\/servlet-name&gt;\r\n        &lt;servlet-class&gt;\r\n            org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher\r\n        &lt;\/servlet-class&gt;\r\n        &lt;init-param&gt;\r\n        &lt;param-name&gt;javax.ws.rs.Application&lt;\/param-name&gt;\r\n        &lt;param-value&gt;com.scdev.jaxrs.resteasy.app.MyApp&lt;\/param-value&gt;\r\n    &lt;\/init-param&gt;\r\n    &lt;\/servlet&gt;\r\n  \r\n    &lt;servlet-mapping&gt;\r\n        &lt;servlet-name&gt;resteasy-servlet&lt;\/servlet-name&gt;\r\n        &lt;url-pattern&gt;\/*&lt;\/url-pattern&gt;\r\n    &lt;\/servlet-mapping&gt;\r\n\t\r\n&lt;\/web-app&gt;\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001init-param\u3067MyApp\u30af\u30e9\u30b9\u3092\u5024\u3068\u3057\u3066\u6307\u5b9a\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u3053\u3067\u306f\u3001javax.ws.rs.core.Application\u30af\u30e9\u30b9\u3092\u62e1\u5f35\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.jaxrs.resteasy.app;\r\n\r\nimport java.util.HashSet;\r\nimport java.util.Set;\r\n\r\nimport javax.ws.rs.core.Application;\r\n\r\nimport com.scdev.jaxrs.service.PersonServiceImpl;\r\n\r\npublic class MyApp extends Application {\r\n\t\r\n\tprivate Set&lt;Object&gt; singletons = new HashSet&lt;Object&gt;();\r\n\r\n\tpublic MyApp() {\r\n\t\tsingletons.add(new PersonServiceImpl());\r\n\t}\r\n\r\n\t@Override\r\n\tpublic Set&lt;Object&gt; getSingletons() {\r\n\t\treturn singletons;\r\n\t}\r\n\r\n}\r\n<\/code><\/pre>\n<h3>RESTEasy\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u30c6\u30b9\u30c8<\/h3>\n<p>\u305d\u308c\u3067\u7d42\u308f\u308a\u3067\u3059\u3002\u79c1\u305f\u3061\u306e\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u306f\u3001RESTEasy JAX-RS\u306e\u5b9f\u88c5\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002\u4ee5\u4e0b\u306f\u3001Postman Chrome\u62e1\u5f35\u6a5f\u80fd\u306e\u30c6\u30b9\u30c8\u306e\u3044\u304f\u3064\u304b\u306e\u51fa\u529b\u4f8b\u3067\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>getDummy<\/li>\n<li>add<\/li>\n<li>get<\/li>\n<\/ul>\n<p>\u305d\u308c\u304c\u3001Restful Web\u30b5\u30fc\u30d3\u30b9\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u3059\u3079\u3066\u3067\u3059\u3002JAX-RS\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066\u5b66\u3093\u3067\u3001\u30b3\u30fc\u30c9\u306e\u518d\u5229\u7528\u3068Jersey\u304b\u3089RESTEasy\u3078\u306e\u30b9\u30e0\u30fc\u30ba\u306a\u79fb\u884c\u306e\u5229\u70b9\u3092\u7406\u89e3\u3057\u3066\u3044\u305f\u3060\u3051\u305f\u3053\u3068\u3092\u9858\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java\u3067\u306eRestful Web\u30b5\u30fc\u30d3\u30b9\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3078\u3088\u3046\u3053\u305d\u3002REST\u306fREpresentational State Transfer\u306e\u7565\u3067\u3059\u3002REST\u306f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u901a\u3058\u3066\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,61],"class_list":["post-986","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-26","tag-61"],"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>Java\u306b\u3088\u308bRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Java\u306b\u3088\u308bRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\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\/ja\/blog\/java\u306b\u3088\u308brestful-web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java\u306b\u3088\u308bRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" \/>\n<meta property=\"og:description\" content=\"Java\u306b\u3088\u308bRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/java\u306b\u3088\u308brestful-web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-18T22:56:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T19:03:56+00:00\" \/>\n<meta name=\"author\" content=\"\u7d50\u8863, \u6625\u82b1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u7d50\u8863, \u6625\u82b1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"27\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%82%88%e3%82%8brestful-web%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%82%88%e3%82%8brestful-web%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/\",\"name\":\"Java\u306b\u3088\u308bRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2023-09-18T22:56:34+00:00\",\"dateModified\":\"2025-07-31T19:03:56+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/e52a686063ac76fd8cc6f539d41497ac\"},\"description\":\"Java\u306b\u3088\u308bRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%82%88%e3%82%8brestful-web%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%82%88%e3%82%8brestful-web%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%82%88%e3%82%8brestful-web%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\u306b\u3088\u308bRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/e52a686063ac76fd8cc6f539d41497ac\",\"name\":\"\u7d50\u8863, \u6625\u82b1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c74c6e2eb915a3c8e795b3934aa25a7333e0b38e7f1c7baf52785286ad51105e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c74c6e2eb915a3c8e795b3934aa25a7333e0b38e7f1c7baf52785286ad51105e?s=96&d=mm&r=g\",\"caption\":\"\u7d50\u8863, \u6625\u82b1\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/yuiharuka\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%82%88%e3%82%8brestful-web%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Java\u306b\u3088\u308bRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb - Blog - Silicon Cloud","description":"Java\u306b\u3088\u308bRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","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\/ja\/blog\/java\u306b\u3088\u308brestful-web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\/","og_locale":"ja_JP","og_type":"article","og_title":"Java\u306b\u3088\u308bRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb","og_description":"Java\u306b\u3088\u308bRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/java\u306b\u3088\u308brestful-web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-09-18T22:56:34+00:00","article_modified_time":"2025-07-31T19:03:56+00:00","author":"\u7d50\u8863, \u6625\u82b1","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u7d50\u8863, \u6625\u82b1","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"27\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%82%88%e3%82%8brestful-web%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%82%88%e3%82%8brestful-web%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/","name":"Java\u306b\u3088\u308bRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2023-09-18T22:56:34+00:00","dateModified":"2025-07-31T19:03:56+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/e52a686063ac76fd8cc6f539d41497ac"},"description":"Java\u306b\u3088\u308bRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%82%88%e3%82%8brestful-web%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%82%88%e3%82%8brestful-web%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%82%88%e3%82%8brestful-web%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Java\u306b\u3088\u308bRestful Web\u30b5\u30fc\u30d3\u30b9\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/e52a686063ac76fd8cc6f539d41497ac","name":"\u7d50\u8863, \u6625\u82b1","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c74c6e2eb915a3c8e795b3934aa25a7333e0b38e7f1c7baf52785286ad51105e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c74c6e2eb915a3c8e795b3934aa25a7333e0b38e7f1c7baf52785286ad51105e?s=96&d=mm&r=g","caption":"\u7d50\u8863, \u6625\u82b1"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/yuiharuka\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%82%88%e3%82%8brestful-web%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%81%ae%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=986"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/986\/revisions"}],"predecessor-version":[{"id":47594,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/986\/revisions\/47594"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}