{"id":85,"date":"2025-07-21T17:11:03","date_gmt":"2025-07-21T08:11:03","guid":{"rendered":"https:\/\/i-third.org\/blog\/?p=85"},"modified":"2025-07-21T17:13:45","modified_gmt":"2025-07-21T08:13:45","slug":"spring-boot%e3%81%a8jsp%e9%80%a3%e6%90%ba%ef%bc%81%e3%83%a2%e3%83%80%e3%83%b3%e9%96%8b%e7%99%ba%e3%81%a8%e3%83%ac%e3%82%ac%e3%82%b7%e3%83%bc%e8%b3%87%e7%94%a3%e3%82%92%e4%b8%a1%e7%ab%8b%e3%81%99","status":"publish","type":"post","link":"https:\/\/i-third.org\/blog\/?p=85","title":{"rendered":"Spring Boot\u3068JSP\u9023\u643a\uff01\u30e2\u30c0\u30f3\u958b\u767a\u3068\u30ec\u30ac\u30b7\u30fc\u8cc7\u7523\u3092\u4e21\u7acb\u3059\u308b\u5b9f\u8df5\u30ac\u30a4\u30c9"},"content":{"rendered":"<article>\n<p>\u591a\u304f\u306e\u4f01\u696d\u304cDX\u3092\u63a8\u9032\u3059\u308b\u4e2d\u3067\u3001\u65e2\u5b58\u306eJSP\u8cc7\u7523\u3092\u6d3b\u7528\u3057\u3064\u3064\u3001Spring Boot\u306e\u9ad8\u901f\u958b\u767a\u80fd\u529b\u3092\u53d6\u308a\u5165\u308c\u305f\u3044\u3068\u8003\u3048\u308b\u30b7\u30b9\u30c6\u30e0\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u7686\u69d8\u3078\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u79c1\u304c\u30d6\u30ed\u30b0\u7de8\u96c6\u9577\u3068\u3057\u3066\u3001\u307e\u305f\u30b7\u30b9\u30c6\u30e0\u30a8\u30f3\u30b8\u30cb\u30a2\u3068\u3057\u3066\u306e\u7d4c\u9a13\u3092\u57fa\u306b\u3001Spring Boot\u3068JSP\u3092\u52b9\u679c\u7684\u306b\u9023\u643a\u3055\u305b\u3001\u30e2\u30c0\u30f3\u306aWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3059\u308b\u305f\u3081\u306e\u5177\u4f53\u7684\u306a\u624b\u9806\u3068\u5b9f\u8df5\u4f8b\u3092\u8a73\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p>\u300cSpring Boot\u306fJAR\u5f62\u5f0f\u304c\u4e3b\u6d41\u3067JSP\u306f\u76f8\u6027\u304c\u60aa\u3044\u306e\u3067\u306f\uff1f\u300d\u3068\u3044\u3063\u305f\u7591\u554f\u3092\u304a\u6301\u3061\u306e\u65b9\u3082\u3044\u3089\u3063\u3057\u3083\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u3054\u5b89\u5fc3\u304f\u3060\u3055\u3044\u3002\u672c\u8a18\u4e8b\u3067\u306f\u3001\u305d\u306e\u61f8\u5ff5\u3092\u89e3\u6d88\u3057\u3001\u4e21\u8005\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3059WAR\u5f62\u5f0f\u3067\u306e\u30c7\u30d7\u30ed\u30a4\u6226\u7565\u3092\u4e2d\u5fc3\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<h2>\u76ee\u6b21<\/h2>\n<ul>\n<li><a href=\"#section-1\">\u306a\u305c\u4eca\u3001Spring Boot\u3068JSP\u306e\u9023\u643a\u304c\u5fc5\u8981\u306a\u306e\u304b\uff1f<\/a><\/li>\n<li><a href=\"#section-2\">\u524d\u63d0\u77e5\u8b58\uff1aSpring Boot\u3068JSP\u306e\u57fa\u672c<\/a><\/li>\n<li><a href=\"#section-3\">\u5b9f\u8df5\uff1aSpring Boot (WAR) \u3068JSP\u3067Web\u30a2\u30d7\u30ea\u3092\u69cb\u7bc9\u3059\u308b\u624b\u9806<\/a><\/li>\n<li><a href=\"#section-4\">\u5b9f\u8df5\u4f8b\uff1aWeb\u30a2\u30d7\u30eaA (JSP\u30d5\u30ed\u30f3\u30c8) \u3068Web\u30a2\u30d7\u30eaB (API) \u306e\u9023\u643a<\/a><\/li>\n<li><a href=\"#section-5\">\u307e\u3068\u3081\uff1aSpring Boot\u3068JSP\u3067\u672a\u6765\u3092\u5207\u308a\u62d3\u304f<\/a><\/li>\n<li><a href=\"#section-6\">\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3078\uff1a\u66f4\u306a\u308bDX\u63a8\u9032\u306e\u305f\u3081\u306b<\/a><\/li>\n<\/ul>\n<hr>\n<h2 id=\"section-1\">\u306a\u305c\u4eca\u3001Spring Boot\u3068JSP\u306e\u9023\u643a\u304c\u5fc5\u8981\u306a\u306e\u304b\uff1f<\/h2>\n<p>\u73fe\u4ee3\u306e\u30b7\u30b9\u30c6\u30e0\u958b\u767a\u3067\u306f\u3001\u8fc5\u901f\u306a\u5e02\u5834\u6295\u5165\u3068\u9ad8\u3044\u4fdd\u5b88\u6027\u304c\u6c42\u3081\u3089\u308c\u307e\u3059\u3002Spring Boot\u306f\u3001\u305d\u306e\u300c\u8a2d\u5b9a\u3088\u308a\u898f\u7d04\u300d\u306e\u601d\u60f3\u3068\u8c4a\u5bcc\u306a\u30b9\u30bf\u30fc\u30bf\u30fc\u306b\u3088\u308a\u3001\u958b\u767a\u52b9\u7387\u3092\u98db\u8e8d\u7684\u306b\u5411\u4e0a\u3055\u305b\u307e\u3059\u3002\u4e00\u65b9\u3067\u3001\u591a\u304f\u306e\u4f01\u696d\u3067\u306f\u9577\u5e74\u57f9\u3063\u3066\u304d\u305fJSP\u30d9\u30fc\u30b9\u306e\u65e2\u5b58\u30b7\u30b9\u30c6\u30e0\u3084\u3001JSP\u958b\u767a\u306b\u6163\u308c\u305f\u6280\u8853\u8cc7\u7523\u304c\u5b58\u5728\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3089\u65e2\u5b58\u306eJSP\u8cc7\u7523\u3092\u6368\u3066\u53bb\u308b\u3053\u3068\u306f\u3001\u30b3\u30b9\u30c8\u9762\u3084\u30ea\u30b9\u30af\u9762\u304b\u3089\u975e\u73fe\u5b9f\u7684\u306a\u5834\u5408\u304c\u591a\u3044\u3067\u3059\u3002\u305d\u3053\u3067\u3001Spring Boot\u306e\u30e2\u30c0\u30f3\u306a\u958b\u767a\u624b\u6cd5\u3068\u3001JSP\u306e\u65e2\u5b58\u8cc7\u7523\u3092\u4e21\u7acb\u3055\u305b\u308b\u9023\u643a\u304c\u3001\u73fe\u5b9f\u7684\u306aDX\u63a8\u9032\u306e\u9375\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u7279\u306b\u3001UI\u5c64\u306fJSP\u3067\u67d4\u8edf\u306b\u8868\u73fe\u3057\u3064\u3064\u3001\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306e\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u3084API\u9023\u643a\u306fSpring Boot\u306e\u5f37\u529b\u306a\u6a5f\u80fd\u3067\u69cb\u7bc9\u3059\u308b\u3068\u3044\u3063\u305f\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u6226\u7565\u306f\u3001\u591a\u304f\u306e\u4f01\u696d\u306b\u3068\u3063\u3066\u6700\u9069\u306a\u9053\u7b4b\u3068\u306a\u308a\u5f97\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<hr>\n<h2 id=\"section-2\">\u524d\u63d0\u77e5\u8b58\uff1aSpring Boot\u3068JSP\u306e\u57fa\u672c<\/h2>\n<p>\u672c\u8a18\u4e8b\u3092\u6700\u5927\u9650\u306b\u6d3b\u7528\u3057\u3066\u3044\u305f\u3060\u304f\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u57fa\u672c\u7684\u306a\u77e5\u8b58\u304c\u3042\u308b\u3068\u7406\u89e3\u304c\u6df1\u307e\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li><strong>Spring Boot\u306e\u57fa\u790e<\/strong>: \u4f9d\u5b58\u6027\u6ce8\u5165\uff08DI\uff09\u3001Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\uff08MVC\uff09\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u69cb\u9020\u306e\u7406\u89e3\u3002<\/li>\n<li><strong>JSP\u306e\u57fa\u790e<\/strong>: JSP\u306e\u69cb\u6587\u3001EL\u5f0f\u3001JSTL\u3001\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30b3\u30f3\u30c6\u30ca\u3067\u306e\u52d5\u4f5c\u539f\u7406\u3002<\/li>\n<li><strong>Maven\u306e\u57fa\u790e<\/strong>: `pom.xml`\u306e\u8aad\u307f\u66f8\u304d\u3001\u30d3\u30eb\u30c9\u30e9\u30a4\u30d5\u30b5\u30a4\u30af\u30eb\uff08`clean`, `package`\u306a\u3069\uff09\u3002<\/li>\n<li><strong>Tomcat\u306e\u57fa\u790e<\/strong>: \u74b0\u5883\u5909\u6570\uff08`CATALINA_HOME`\uff09\u3001\u30c7\u30d7\u30ed\u30a4\u65b9\u6cd5\uff08WAR\u30d5\u30a1\u30a4\u30eb\uff09\u3002<\/li>\n<\/ul>\n<p>\u7279\u306b\u3001Spring Boot\u304cJAR\u5f62\u5f0f\u3067\u7d44\u307f\u8fbc\u307f\u30b5\u30fc\u30d0\u30fc\u3092\u6301\u3064\u306e\u304c\u4e3b\u6d41\u3067\u3042\u308b\u70b9\u3068\u3001JSP\u304c\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30b3\u30f3\u30c6\u30ca\u4e0a\u3067\u52d5\u4f5c\u3059\u308bView\u6280\u8853\u3067\u3042\u308b\u70b9\u3092\u8e0f\u307e\u3048\u308b\u3068\u3001\u4e21\u8005\u306e\u9023\u643a\u306b\u306f\u5de5\u592b\u304c\u5fc5\u8981\u3067\u3042\u308b\u3053\u3068\u304c\u7406\u89e3\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<hr>\n<h2 id=\"section-3\">\u5b9f\u8df5\uff1aSpring Boot (WAR) \u3068JSP\u3067Web\u30a2\u30d7\u30ea\u3092\u69cb\u7bc9\u3059\u308b\u624b\u9806<\/h2>\n<p>Spring Boot\u3068JSP\u3092\u9023\u643a\u3055\u305b\u308b\u6700\u3082\u5b89\u5b9a\u3057\u305f\u65b9\u6cd5\u306f\u3001Spring Boot\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092WAR\u5f62\u5f0f\u3067\u30d3\u30eb\u30c9\u3057\u3001\u5916\u90e8\u306eTomcat\u306b\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<h3>\u30b9\u30c6\u30c3\u30d71: \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u521d\u671f\u8a2d\u5b9a<\/h3>\n<ol>\n<li><strong>Spring Initializr\u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210<\/strong>:\n<ul>\n<li>Project: Maven Project<\/li>\n<li>Packaging: <strong>WAR<\/strong> \u3092\u9078\u629e<\/li>\n<li>Dependencies: `Spring Web`, `Tomcat Embed Jasper` (JSP\u30b3\u30f3\u30d1\u30a4\u30eb\u7528)<\/li>\n<\/ul>\n<p><strong>\u6ce8\u610f:<\/strong> `tomcat-embed-jasper`\u306f\u3001WAR\u30d1\u30c3\u30b1\u30fc\u30b8\u30f3\u30b0\u306e\u5834\u5408\u3001`provided`\u30b9\u30b3\u30fc\u30d7\u306b\u8a2d\u5b9a\u3057\u304c\u3061\u3067\u3059\u304c\u3001Spring Boot\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u3057\u3066JAR\u5b9f\u884c\u3082\u8996\u91ce\u306b\u5165\u308c\u308b\u306a\u3089`compile`\u30b9\u30b3\u30fc\u30d7\u306e\u307e\u307e\u3067OK\u3067\u3059\u3002\u5916\u90e8Tomcat\u306b\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u969b\u3001Tomcat\u5074\u304cJSP\u30b3\u30f3\u30d1\u30a4\u30eb\u6a5f\u80fd\u3092\u63d0\u4f9b\u3059\u308b\u305f\u3081\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<\/li>\n<li><strong>`pom.xml`\u306e\u78ba\u8a8d<\/strong>:\n<p>\u751f\u6210\u3055\u308c\u305f`pom.xml`\u306b`packaging`\u30bf\u30b0\u304c`war`\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3001`spring-boot-starter-tomcat`\u3084`tomcat-embed-jasper`\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-xml\">&lt;packaging&gt;war&lt;\/packaging&gt;\n&lt;!-- ... --&gt;\n&lt;dependency&gt;\n    &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n    &lt;artifactId&gt;spring-boot-starter-web&lt;\/artifactId&gt;\n&lt;\/dependency&gt;\n&lt;dependency&gt;\n    &lt;groupId&gt;org.apache.tomcat.embed&lt;\/groupId&gt;\n    &lt;artifactId&gt;tomcat-embed-jasper&lt;\/artifactId&gt;\n&lt;\/dependency&gt;\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h3>\u30b9\u30c6\u30c3\u30d72: JSP\u30d5\u30a1\u30a4\u30eb\u306e\u914d\u7f6e\u3068\u8a2d\u5b9a<\/h3>\n<ol>\n<li><strong>JSP\u30d5\u30a1\u30a4\u30eb\u306e\u914d\u7f6e<\/strong>:\n<p>\u5f93\u6765\u306eWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u540c\u69d8\u306b\u3001JSP\u30d5\u30a1\u30a4\u30eb\u306f`src\/main\/webapp\/WEB-INF\/jsp\/`\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u306b\u914d\u7f6e\u3057\u307e\u3059\u3002\u3053\u306e\u30d1\u30b9\u306f\u3001Tomcat\u304cWAR\u30d5\u30a1\u30a4\u30eb\u3092\u5c55\u958b\u3057\u305f\u969b\u306bJSP\u30d5\u30a1\u30a4\u30eb\u3092\u8a8d\u8b58\u3067\u304d\u308b\u6a19\u6e96\u7684\u306a\u5834\u6240\u3067\u3059\u3002<\/p>\n<pre><code class=\"language-text\">src\n\u2514\u2500\u2500 main\n    \u2514\u2500\u2500 webapp\n        \u2514\u2500\u2500 WEB-INF\n            \u2514\u2500\u2500 jsp\n                \u2514\u2500\u2500 welcome.jsp\n        \u2514\u2500\u2500 index.html (\u307e\u305f\u306f\u4ed6\u306e\u9759\u7684\u30d5\u30a1\u30a4\u30eb)\n<\/code><\/pre>\n<\/li>\n<li><strong>`application.properties`\u306e\u8a2d\u5b9a<\/strong>:\n<p>Spring Boot\u306bJSP\u306e\u5834\u6240\u3092\u6559\u3048\u308b\u305f\u3081\u306b\u3001`src\/main\/resources\/application.properties`\u306b\u30d3\u30e5\u30fc\u30ea\u30be\u30eb\u30d0\u30fc\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-properties\">spring.mvc.view.prefix=\/WEB-INF\/jsp\/\nspring.mvc.view.suffix=.jsp\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h3>\u30b9\u30c6\u30c3\u30d73: \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306e\u4f5c\u6210<\/h3>\n<p>JSP\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u7c21\u5358\u306aSpring MVC\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-java\">package com.example.mywebapp.controller;\n\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\n\n@Controller\npublic class ViewController {\n\n    @GetMapping(\"\/welcome\")\n    public String showWelcomePage() {\n        return \"welcome\"; \/\/ src\/main\/webapp\/WEB-INF\/jsp\/welcome.jsp \u3092\u89e3\u6c7a\n    }\n}\n<\/code><\/pre>\n<h3>\u30b9\u30c6\u30c3\u30d74: WAR\u30d5\u30a1\u30a4\u30eb\u306e\u30d3\u30eb\u30c9\u3068\u30c7\u30d7\u30ed\u30a4<\/h3>\n<ol>\n<li><strong>WAR\u30d5\u30a1\u30a4\u30eb\u306e\u30d3\u30eb\u30c9<\/strong>:\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067Maven\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3001WAR\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">mvn clean package\n<\/code><\/pre>\n<p>`target\/`\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b`your-app-name.war`\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<\/li>\n<li><strong>Tomcat\u3078\u306e\u30c7\u30d7\u30ed\u30a4<\/strong>:\n<p>\u751f\u6210\u3055\u308c\u305fWAR\u30d5\u30a1\u30a4\u30eb\u3092\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u306eTomcat\u306e`%CATALINA_HOME%\\webapps`\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002<\/p>\n<\/li>\n<li><strong>Tomcat\u306e\u8d77\u52d5<\/strong>:\n<p>Tomcat\u3092\u8d77\u52d5\u307e\u305f\u306f\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">cd %CATALINA_HOME%\\bin\nshutdown.bat # \u5fc5\u8981\u3067\u3042\u308c\u3070\nstartup.bat\n<\/code><\/pre>\n<p>\u3053\u308c\u306b\u3088\u308a\u3001Tomcat\u304cWAR\u30d5\u30a1\u30a4\u30eb\u3092\u81ea\u52d5\u7684\u306b\u5c55\u958b\u3057\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u30c7\u30d7\u30ed\u30a4\u3055\u308c\u307e\u3059\u3002<\/p>\n<\/li>\n<li><strong>\u52d5\u4f5c\u78ba\u8a8d<\/strong>:\n<p>\u30d6\u30e9\u30a6\u30b6\u3067`http:\/\/localhost:8080\/\u3042\u306a\u305f\u306eWAR\u30d5\u30a1\u30a4\u30eb\u540d\uff08.war\u3092\u9664\u304f\uff09\/welcome` \u306b\u30a2\u30af\u30bb\u30b9\u3057\u3001JSP\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<\/li>\n<\/ol>\n<hr>\n<h2 id=\"section-4\">\u5b9f\u8df5\u4f8b\uff1aWeb\u30a2\u30d7\u30eaA (JSP\u30d5\u30ed\u30f3\u30c8) \u3068Web\u30a2\u30d7\u30eaB (API) \u306e\u9023\u643a<\/h2>\n<p>\u3053\u3053\u304b\u3089\u306f\u3001Spring Boot (WAR) \u306eWeb\u30a2\u30d7\u30eaA\u3068\u3001\u72ec\u7acb\u3057\u305fAPI\u3067\u3042\u308bSpring Boot (JAR) \u306eWeb\u30a2\u30d7\u30eaB\u3092\u9023\u643a\u3055\u305b\u308b\u5177\u4f53\u7684\u306a\u5b9f\u8df5\u4f8b\u3067\u3059\u3002<\/p>\n<h3>Web\u30a2\u30d7\u30eaB (JAR) \u306e\u6e96\u5099 (\u30dd\u30fc\u30c88081\u3067\u52d5\u4f5c)<\/h3>\n<p>Web\u30a2\u30d7\u30eaB\u306f\u3001Spring Boot (JAR) \u3067\u69cb\u7bc9\u3057\u3001Gemini API\u3068\u9023\u643a\u3059\u308bRESTful API\u3068\u3057\u3066\u52d5\u4f5c\u3055\u305b\u307e\u3059\u3002Web\u30a2\u30d7\u30eaA\u3068\u306e\u30dd\u30fc\u30c8\u7af6\u5408\u3092\u907f\u3051\u308b\u305f\u3081\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e8080\u30dd\u30fc\u30c8\u3067\u306f\u306a\u304f\u3001\u4f8b\u3048\u30708081\u30dd\u30fc\u30c8\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<ol>\n<li><strong>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210<\/strong>: `spring-boot-starter-web`, `com.google.generativeai:java-genai` \u3092\u4f9d\u5b58\u95a2\u4fc2\u306b\u6301\u3064JAR\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u4f5c\u6210\u3002<\/li>\n<li><strong>\u30dd\u30fc\u30c8\u8a2d\u5b9a<\/strong>: `src\/main\/resources\/application.properties` \u306b `server.port=8081` \u3068 `google.gemini.api-key=YOUR_API_KEY` \u3092\u8a2d\u5b9a\u3002<\/li>\n<li><strong>API\u5b9f\u88c5<\/strong>: Gemini API\u547c\u3073\u51fa\u3057\u30ed\u30b8\u30c3\u30af\u3092\u6301\u3064`GeminiApiService`\u3068\u3001JSON\u5f62\u5f0f\u306e\u30ea\u30af\u30a8\u30b9\u30c8\/\u30ec\u30b9\u30dd\u30f3\u30b9POJO\u3001\u305d\u3057\u3066\u305d\u308c\u3089\u3092\u5229\u7528\u3059\u308b`GeminiController` (`@RequestMapping(&#8220;\/api\/gemini&#8221;)`) \u3092\u5b9f\u88c5\u3002<\/li>\n<li><strong>\u30d3\u30eb\u30c9\u3068\u8d77\u52d5<\/strong>: `mvn clean package` \u3067JAR\u3092\u751f\u6210\u3057\u3001`java -jar target\/your-api-service.jar` \u3067\u8d77\u52d5\u3002<\/li>\n<\/ol>\n<h3>Web\u30a2\u30d7\u30eaA (WAR) \u304b\u3089Web\u30a2\u30d7\u30eaB\u3078\u306e\u540c\u671f\u547c\u3073\u51fa\u3057<\/h3>\n<p>Web\u30a2\u30d7\u30eaA\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u53d6\u308a\u3001JSP\u3067\u8868\u793a\u3059\u308b\u3060\u3051\u3067\u306a\u304f\u3001Web\u30a2\u30d7\u30eaB\u306eAPI\u3092\u540c\u671f\u7684\u306b\u547c\u3073\u51fa\u3057\u3001\u305d\u306e\u7d50\u679c\u3092JSP\u306b\u6e21\u3059\u5f79\u5272\u3092\u62c5\u3044\u307e\u3059\u3002<\/p>\n<ol>\n<li><strong>`RestTemplate`\u306eBean\u5b9a\u7fa9<\/strong>: Web\u30a2\u30d7\u30eaA\u306e\u30e1\u30a4\u30f3\u30af\u30e9\u30b9\u306b`RestTemplate`\u306eBean\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/li>\n<li><strong>POJO\u306e\u30b3\u30d4\u30fc<\/strong>: Web\u30a2\u30d7\u30eaB\u3067\u5b9a\u7fa9\u3057\u305f`GeminiRequest`\u3068`GeminiResponse`\u306ePOJO\u30af\u30e9\u30b9\u3092\u3001Web\u30a2\u30d7\u30eaA\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u3082\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002<\/li>\n<li><strong>API\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b5\u30fc\u30d3\u30b9\u306e\u4f5c\u6210<\/strong>: `WebBClientService`\u3092\u4f5c\u6210\u3057\u3001`RestTemplate`\u3092\u4f7f\u7528\u3057\u3066Web\u30a2\u30d7\u30eaB\u306eAPI (`http:\/\/localhost:8081\/api\/gemini\/generate`) \u3092\u547c\u3073\u51fa\u3059\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002Web\u30a2\u30d7\u30eaA\u306e`application.properties`\u306b`webb.api.url=http:\/\/localhost:8081`\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li><strong>JSP\u8868\u793a\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306e\u4fee\u6b63<\/strong>: \u30e6\u30fc\u30b6\u30fc\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u53d6\u308b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u5b9f\u88c5\u3057\u3001\u305d\u306e\u4e2d\u3067`WebBClientService`\u3092\u547c\u3073\u51fa\u3057\u3001\u53d6\u5f97\u3057\u305f\u30ec\u30b9\u30dd\u30f3\u30b9\u30c7\u30fc\u30bf\u3092JSP\u306b\u30e2\u30c7\u30eb\u5c5e\u6027\u3068\u3057\u3066\u6e21\u3057\u307e\u3059\u3002<\/li>\n<li><strong>JSP\u3067\u306e\u8868\u793a<\/strong>: JSP\u5185\u3067EL\u5f0f\u306a\u3069\u3092\u4f7f\u3063\u3066\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u304b\u3089\u6e21\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n<p>\u3053\u308c\u306b\u3088\u308a\u3001\u30d6\u30e9\u30a6\u30b6\uff08\u2460\u975e\u540c\u671f\uff09\u2192Web\u30a2\u30d7\u30eaA\uff08\u2461\u540c\u671f\uff09\u2192Web\u30a2\u30d7\u30eaB\uff08\u2462\u540c\u671f\uff09\u2192Gemini API\uff08\u2463\u540c\u671f\uff09\u2192Web\u30a2\u30d7\u30eaB\uff08\u2462\u540c\u671f\uff09\u2192Web\u30a2\u30d7\u30eaA\uff08\u2461\u975e\u540c\u671f\uff09\u2192\u30d6\u30e9\u30a6\u30b6\u3068\u3044\u3046\u30c7\u30fc\u30bf\u30d5\u30ed\u30fc\u304c\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n<hr>\n<h2 id=\"section-5\">\u307e\u3068\u3081\uff1aSpring Boot\u3068JSP\u3067\u672a\u6765\u3092\u5207\u308a\u62d3\u304f<\/h2>\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001Spring Boot\u306e\u9ad8\u901f\u958b\u767a\u3068JSP\u306e\u65e2\u5b58\u8cc7\u7523\u6d3b\u7528\u3092\u4e21\u7acb\u3055\u305b\u308b\u3001WAR\u5f62\u5f0f\u3067\u306e\u30c7\u30d7\u30ed\u30a4\u6226\u7565\u3092\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002JAR\u5f62\u5f0f\u3067\u306eJSP\u5229\u7528\u306e\u96e3\u3057\u3055\u3092\u4e57\u308a\u8d8a\u3048\u3001\u5916\u90e8Tomcat\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u5b89\u5b9a\u3057\u305fJSP\u30d9\u30fc\u30b9\u306eUI\u3068\u3001Spring Boot\u306e\u5f37\u529b\u306a\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u51e6\u7406\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>Web\u30a2\u30d7\u30eaA\uff08WAR\uff09\u3068Web\u30a2\u30d7\u30eaB\uff08JAR\uff09\u3068\u3044\u3046\u4e8c\u5c64\u69cb\u9020\u306f\u3001\u30de\u30a4\u30af\u30ed\u30b5\u30fc\u30d3\u30b9\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306e\u7b2c\u4e00\u6b69\u3068\u3082\u8a00\u3048\u3001\u305d\u308c\u305e\u308c\u306e\u8cac\u52d9\u3092\u660e\u78ba\u306b\u5206\u96e2\u3059\u308b\u3053\u3068\u3067\u3001\u958b\u767a\u52b9\u7387\u3068\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027\u3092\u9ad8\u3081\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u65e2\u5b58\u30b7\u30b9\u30c6\u30e0\u3092\u6d3b\u304b\u3057\u3064\u3064\u3001AI\u9023\u643a\u306e\u3088\u3046\u306a\u30e2\u30c0\u30f3\u306a\u6280\u8853\u3092\u53d6\u308a\u5165\u308c\u308bDX\u6226\u7565\u3092\u5f37\u529b\u306b\u63a8\u9032\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<hr>\n<h2 id=\"section-6\">\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3078\uff1a\u66f4\u306a\u308bDX\u63a8\u9032\u306e\u305f\u3081\u306b<\/h2>\n<p>\u3053\u306e\u5b9f\u8df5\u30ac\u30a4\u30c9\u304c\u3001\u3042\u306a\u305f\u306eSpring Boot\u3068JSP\u3092\u7528\u3044\u305f\u958b\u767a\u306e\u4e00\u52a9\u3068\u306a\u308c\u3070\u5e78\u3044\u3067\u3059\u3002\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3068\u3057\u3066\u3001\u4ee5\u4e0b\u3092\u691c\u8a0e\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<ul>\n<li><strong>\u8a8d\u8a3c\u30fb\u8a8d\u53ef\u306e\u5c0e\u5165<\/strong>: Spring Security\u3092\u7528\u3044\u305f\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u6a5f\u80fd\u306e\u8ffd\u52a0\u3002<\/li>\n<li><strong>\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u5f37\u5316<\/strong>: \u30b0\u30ed\u30fc\u30d0\u30eb\u306a\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3084\u3001API\u306e\u30a8\u30e9\u30fc\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u6a19\u6e96\u5316\u3002<\/li>\n<li><strong>\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u6280\u8853\u306e\u5c0e\u5165<\/strong>: JSP\u304b\u3089\u3001React\u3084Vue.js\u3068\u3044\u3063\u305fSPA\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3078\u306e\u79fb\u884c\u691c\u8a0e\u3002<\/li>\n<li><strong>\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u306e\u62e1\u5145<\/strong>: \u5358\u4f53\u30c6\u30b9\u30c8\u3001\u7d50\u5408\u30c6\u30b9\u30c8\u3001E2E\u30c6\u30b9\u30c8\u306e\u5c0e\u5165\u3002<\/li>\n<\/ul>\n<p>\u7591\u554f\u70b9\u3084\u66f4\u306a\u308b\u3054\u76f8\u8ac7\u304c\u3042\u308c\u3070\u3001\u3044\u3064\u3067\u3082\u304a\u58f0\u304c\u3051\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u304c\u7686\u69d8\u306eDX\u63a8\u9032\u3068\u30b5\u30a4\u30c8\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u5897\u52a0\u306b\u8ca2\u732e\u3059\u308b\u3053\u3068\u3092\u9858\u3063\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>\u95a2\u9023\u60c5\u5831:<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/spring.io\/projects\/spring-boot\" target=\"_blank\" rel=\"noopener\">Spring Boot \u516c\u5f0f\u30b5\u30a4\u30c8<\/a><\/li>\n<li><a href=\"https:\/\/docs.oracle.com\/javaee\/7\/api\/javax\/servlet\/jsp\/package-summary.html\" target=\"_blank\" rel=\"noopener\">JavaServer Pages (JSP) \u4ed5\u69d8<\/a><\/li>\n<li><a href=\"https:\/\/ai.google.dev\/gemini-api\/docs\" target=\"_blank\" rel=\"noopener\">Google Gemini API (Vertex AI)<\/a><\/li>\n<\/ul>\n<p>\u3053\u306e\u8a18\u4e8b\u304c\u5f79\u306b\u7acb\u3063\u305f\u3068\u611f\u3058\u305f\u3089\u3001\u305c\u3072SNS\u3067\u306e\u30b7\u30a7\u30a2\u3084\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3092\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\uff01<\/p>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<p>\u591a\u304f\u306e\u4f01\u696d\u304cDX\u3092\u63a8\u9032\u3059\u308b\u4e2d\u3067\u3001\u65e2\u5b58\u306eJSP\u8cc7\u7523\u3092\u6d3b\u7528\u3057\u3064\u3064\u3001Spring Boot\u306e\u9ad8\u901f\u958b\u767a\u80fd\u529b\u3092\u53d6\u308a\u5165\u308c\u305f\u3044\u3068\u8003\u3048\u308b\u30b7\u30b9\u30c6\u30e0\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u7686\u69d8\u3078\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u79c1\u304c\u30d6\u30ed\u30b0\u7de8\u96c6\u9577\u3068\u3057\u3066\u3001\u307e\u305f\u30b7\u30b9\u30c6\u30e0\u30a8\u30f3\u30b8\u30cb\u30a2\u3068\u3057\u3066\u306e\u7d4c\u9a13&hellip;<\/p>\n","protected":false},"author":1,"featured_media":87,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-85","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-7"],"_links":{"self":[{"href":"https:\/\/i-third.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i-third.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i-third.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i-third.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i-third.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=85"}],"version-history":[{"count":5,"href":"https:\/\/i-third.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/85\/revisions"}],"predecessor-version":[{"id":92,"href":"https:\/\/i-third.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/85\/revisions\/92"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/i-third.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/87"}],"wp:attachment":[{"href":"https:\/\/i-third.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i-third.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i-third.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}