{"id":25,"date":"2020-03-08T23:16:10","date_gmt":"2020-03-08T14:16:10","guid":{"rendered":"http:\/\/www.skyer9.pe.kr\/wordpress\/?p=25"},"modified":"2020-03-28T23:50:43","modified_gmt":"2020-03-28T14:50:43","slug":"springboot2fromhellotoquerydsl-hello-world","status":"publish","type":"post","link":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=25","title":{"rendered":"[From Hello To QueryDSL] Hello, World! (1\/12)"},"content":{"rendered":"<h1>Hello, World!<\/h1>\n<p>Spring Boot 2.1 \ud504\ub85c\uc81d\ud2b8\ub97c \uc9c4\ud589\ud558\uae30\uc5d0 \uc55e\uc11c \uacf5\ubd80\ud55c \ub0b4\uc6a9\uc744 \uc815\ub9ac\ud574 \ub461\ub2c8\ub2e4.<\/p>\n<h2>\uac1c\ubc1c\ud658\uacbd<\/h2>\n<ul>\n<li>Spring Boot 2.1.x<\/li>\n<li>Gradle 4.10.2<\/li>\n<\/ul>\n<p>Gradle 5.x \ub97c \uc0ac\uc6a9\ud558\uace0 \uc2f6\uc5c8\uc9c0\ub9cc, querydsl \uc744 \uc0ac\uc6a9\ud558\ub824\uace0 \ud558\ub2c8 4.x \ub97c \uc0ac\uc6a9\ud560 \uc218\ubc16\uc5d0 \uc5c6\ub124\uc694.(2020-03-08 \uae30\uc900)<\/p>\n<p>\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ud504\ub85c\uc81d\ud2b8\uac00 \ucc98\uc74c\uc774\ub77c\uba74 <a href=\"\/wordpress\/?p=43\">\uc0c8 \ud504\ub85c\uc81d\ud2b8 \uc0dd\uc131\ud558\uae30<\/a> \ub97c \uba3c\uc800 \ucc38\uace0\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.<\/p>\n<h2>\uc124\uc815<\/h2>\n<p>\/gradle\/wrapper\/gradle-wrapper.properties<\/p>\n<pre><code class=\"language-gradle\">distributionUrl=https\\:\/\/services.gradle.org\/distributions\/gradle-4.10.2-all.zip\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper\/dists\nzipStorePath=wrapper\/dists\nzipStoreBase=GRADLE_USER_HOME<\/code><\/pre>\n<p>\/build.gradle<\/p>\n<pre><code class=\"language-gradle\">buildscript {\n    ext {\n        springBootVersion = &#039;2.1.13.RELEASE&#039;\n    }\n    repositories {\n        mavenCentral()\n        jcenter()\n    }\n    dependencies {\n        classpath(&quot;org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}&quot;)\n    }\n}\n\napply plugin: &#039;java&#039;\napply plugin: &#039;war&#039;\napply plugin: &#039;org.springframework.boot&#039;\napply plugin: &#039;io.spring.dependency-management&#039;\n\ngroup &#039;kr.co.episode.example&#039;\nversion &#039;0.0.1-SNAPSHOT&#039;\nsourceCompatibility = 11\n\nrepositories {\n    mavenCentral()\n    jcenter()\n}\n\ndependencies {\n    compile(&#039;org.springframework.boot:spring-boot-starter-web&#039;)\n    compile(&#039;org.projectlombok:lombok&#039;)\n    compile(&#039;org.springframework.boot:spring-boot-starter-thymeleaf&#039;)\n    testCompile(&#039;org.springframework.boot:spring-boot-starter-test&#039;)\n}<\/code><\/pre>\n<h2>\ucf54\ub4dc<\/h2>\n<p>\/src\/main\/java\/kr\/co\/episode\/example\/ExampleApplication.java<\/p>\n<pre><code class=\"language-java\">package kr.co.episode.example;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n@SpringBootApplication\npublic class ExampleApplication {\n\n    public static void main(String[] args) {\n        SpringApplication.run(ExampleApplication.class, args);\n    }\n\n}<\/code><\/pre>\n<p>\/src\/main\/java\/kr\/co\/episode\/example\/web\/IndexController.java<\/p>\n<pre><code class=\"language-java\">package kr.co.episode.example.web;\n\nimport lombok.RequiredArgsConstructor;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\n\n@RequiredArgsConstructor\n@Controller\npublic class IndexController {\n\n    @GetMapping(&quot;\/&quot;)\n    public String index() {\n        return &quot;index&quot;;\n    }\n}<\/code><\/pre>\n<p>src\/main\/resuurces\/templates\/index.html<\/p>\n<pre><code class=\"language-html\">&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;en&quot;&gt;\n&lt;head&gt;\n    &lt;meta charset=&quot;UTF-8&quot;&gt;\n    &lt;title&gt;Title&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\nHello, World!\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<h2>\uc2e4\ud589<\/h2>\n<p><code>ExampleApplication.java<\/code> \ud30c\uc77c\uc5d0 \ub9c8\uc6b0\uc2a4\ub97c \uc62c\ub9ac\uace0 \uc624\ub978\ucabd \ud074\ub9ad\uc744 \ud558\uba74 <code>run ExampleApplication.main()<\/code> \uc744 \uc2e4\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ub2e4\uc74c\uc5d0 \ube0c\ub77c\uc6b0\uc800\uc5d0\uc11c <code>http:\/\/localhost:8080\/<\/code> \uc744 \uc811\uc18d\ud558\uba74 <code>Hello, World!<\/code> \ub97c \ubcfc \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>\uc124\uba85<\/h2>\n<h3>\ub514\ub809\ud1a0\ub9ac \uad6c\uc870<\/h3>\n<p><img decoding=\"async\" src=\"\/wordpress\/wp-content\/uploads\/2020\/03\/20200310-01.png\" alt=\"\" \/><\/p>\n<p><code>build.gradle<\/code> \uc774 \ud328\ud0a4\uc9c0 \ub9e4\ub2c8\uc800 \uc124\uc815\uc785\ub2c8\ub2e4. dependencies \uc5d0 \ud544\uc694\ud55c \ub77c\uc774\ube0c\ub7ec\ub9ac\ub97c \ucd94\uac00\ud568\uc73c\ub85c \ud504\ub85c\uc81d\ud2b8\uc5d0\uc11c \ub77c\uc774\ube0c\ub7ec\ub9ac\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\uac8c \ub429\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-gradle\">dependencies {\n    compile(&#039;org.springframework.boot:spring-boot-starter-web&#039;)\n    compile(&#039;org.projectlombok:lombok&#039;)\n    compile(&#039;org.springframework.boot:spring-boot-starter-thymeleaf&#039;)\n    testCompile(&#039;org.springframework.boot:spring-boot-starter-test&#039;)\n}<\/code><\/pre>\n<p>src\/main\/java \uc5d0\ub294 \uc18c\uc2a4\ucf54\ub4dc\uac00 \ub4e4\uc5b4\uac00\uace0, src\/test \uc5d0\ub294 \uc18c\uc2a4\ucf54\ub4dc \ud14c\uc2a4\ud2b8\ub97c \uc704\ud55c \ucf54\ub4dc\uac00 \ub4e4\uc5b4\uac11\ub2c8\ub2e4.<\/p>\n<p>src\/main\/resources\/application.properties \uac00 \uc124\uc815\ud30c\uc77c\uc785\ub2c8\ub2e4. \ud604\uc7ac \ud145\ube44\uc5b4 \uc788\ub294\ub370 \uc65c \ud145\ube44\uc5b4 \uc788\uc5b4\ub3c4 \ud504\ub85c\uc81d\ud2b8\uac00 \uc791\ub3d9\ud558\ub294\uc9c0\ub294 \uc544\ub798\uc5d0\uc11c \uc124\uba85\ud569\ub2c8\ub2e4.<\/p>\n<p>src\/main\/resources\/static \uc5d0\ub294 css\/js \ud30c\uc77c\uc774 \ub4e4\uc5b4\uac11\ub2c8\ub2e4. src\/main\/resources\/template \uc5d0\ub294 html \ud30c\uc77c\uc774 \ub4e4\uc5b4\uac11\ub2c8\ub2e4. \uc815\ud655\ud788\ub294 \ud3f4\ub354\uba85 \uadf8\ub300\ub85c \ud15c\ud50c\ub9bf\uc774 \ub4e4\uc5b4\uac00\ub294\uac74\ub370&#8230; \uc774\uac74 <code>spring-boot-starter-thymeleaf<\/code> \uc124\uba85\ud560 \ub54c \uac19\uc774 \uc124\uba85\ud569\ub2c8\ub2e4.<\/p>\n<h3>Spring Boot \uc758 \uc791\ub3d9\ubc29\uc2dd<\/h3>\n<p>Application \uc744 \uc2e4\ud589\ud55c\uac74 \uc54c\uaca0\ub294\ub370 \uc65c WAS \uac00 \uc2e4\ud589\ub420\uae4c?<\/p>\n<p>Spring Boot \ub294 WAS \uac00 \uc9c0\uc815\ub418\uc5b4 \uc788\uc9c0 \uc54a\uc73c\uba74 \uc790\ub3d9\uc73c\ub85c tomcat \uc744 \ub2e4\uc6b4\ubc1b\uc544 \uc2e4\ud589\uc2dc\ud0b5\ub2c8\ub2e4.<\/p>\n<p>\uc124\uc815\ud30c\uc77c\uc774 \ud145\ube44\uc5b4 \uc788\ub294\ub370 \uc65c tomcat \uc774 \uc791\ub3d9\ud560\uae4c?<\/p>\n<p>Spring Boot \ub294 <code>build.gradle<\/code> \uc5d0 \ucd94\uac00\ub418\uc5b4 \uc788\ub294 \ub77c\uc774\ube0c\ub7ec\ub9ac\ub97c \ubcf4\uace0 \uc790\ub3d9\uc73c\ub85c \uae30\ubcf8\uc801\uc778 \uc124\uc815\uc744 \ud574\ubc84\ub9bd\ub2c8\ub2e4. \uae30\ubcf8\uac12\uacfc \ub2e4\ub978 \uc124\uc815\uc744 \ud558\uace0\uc790 \ud558\uba74 \uadf8 \ub54c \uc124\uc815\ud30c\uc77c\uc5d0 \uc124\uc815\uc744 \ucd94\uac00\ud574 \uc8fc\ub294 \ubc29\uc2dd\uc785\ub2c8\ub2e4.<\/p>\n<p>\uc758\uc874\uc131\uc5d0 <code>spring-boot-starter-web<\/code> \uc774 \ucd94\uac00\ub418\uc5b4 \uc788\uc73c\uba74, WAS \ub85c \uc4f0\uc77c\ub9cc\ud55c \ub77c\uc774\ube0c\ub7ec\ub9ac\uac00 \uc758\uc874\uc131\uc5d0 \uc788\ub294\uc9c0 \ud655\uc778\ud558\uace0, \uc5c6\uc73c\uba74 \uc554\uc2dc\uc801\uc73c\ub85c tomcat \uc744 \uc758\uc874\uc131\uc5d0 \ucd94\uac00\ud574\ubc84\ub9ac\ub294 \ubc29\uc2dd\uc785\ub2c8\ub2e4.<\/p>\n<p>\uadf8\ub7fc, <code>public String index()<\/code> \ub294 \uc65c \uc2e4\ud589\ub420\uae4c?<\/p>\n<p>Spring Boot \ub294 \ud1b0\ucea3 \uc2e4\ud589\uacfc \ub3d9\uc2dc\uc5d0 <code>@Controller<\/code> \uc5b4\ub178\ud14c\uc774\uc158\uc774 \ubd99\uc5b4\uc788\ub294 \ud074\ub798\uc2a4\ub97c \uc790\ub3d9\uc0dd\uc131\ud569\ub2c8\ub2e4.<\/p>\n<p>\uadf8\ub9ac\uace0, \uc0ac\uc6a9\uc790 \ud638\ucd9c\uc774 \uc624\uba74 \ud574\ub2f9 url \uc744 \ubc1b\uc544\uc8fc\ub294 <code>@Controller<\/code> \ub97c \ucc3e\uc544 \uc2e4\ud589\uc2dc\ud0b5\ub2c8\ub2e4.<\/p>\n<p>\uc5ec\uae30\uc11c \uc911\uc694\ud55c\uac74&#8230; xxxController \ub77c\uace0 \ud074\ub798\uc2a4\uba85 \uc9c0\uc5c8\uc73c\ub2c8 \uc54c\uc544\uc11c \uc2e4\ud589\ub418\uaca0\uc9c0? \uc774\uac70 \uc544\ub2d9\ub2c8\ub2e4. \ud074\ub798\uc2a4\uba85\uc774 \uc544\ub2c8\ub77c <code>@Controller<\/code> \uc5b4\ub178\ud14c\uc774\uc158\uc744 \ucc3e\uc544\uac11\ub2c8\ub2e4. \uc5b4\ub178\ud14c\uc774\uc158\uc774 \uc5c6\uc73c\uba74 404 \uc5d0\ub7ec\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring Boot 2.1.x \uae30\ubc18\uc73c\ub85c Hello, World! \ud504\ub85c\uc81d\ud2b8\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/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-25","post","type-post","status-publish","format-standard","hentry","category-spring-boot-2-1"],"_links":{"self":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/25","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=25"}],"version-history":[{"count":24,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions"}],"predecessor-version":[{"id":355,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions\/355"}],"wp:attachment":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}