-[Even beginners can do it! ] How to install Eclipse on Windows 10 (Java environment construction)
As prior knowledge, the contents of the above link are required.
[Window (W)] → [Open Perspective] → [Other]
.
JavaEE
and click the Open
button.
[Help (H)] → [Eclipse Marketplace (M) ...]
.
Install
Spring Tools 4 (aka Spring Tool Suite 4) 4.7.0.RELEASE
.Folder structure
Hello
└─ src
└─ main
├─ java
│ └─ com
│ └─ example
│ └─ demo
│ ├─ HeloController.java
│ └─ HelloApplication.java
└─ resources
├─ application.properties
│
├─ static
└─ templates
└─ index.html
HeloController.java
package com.example.demo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
public class HeloController {
@RequestMapping(value = "/", method = RequestMethod.GET)
public String index(Model model) {
model.addAttribute("message", "Hello Springboot");
return "index";
}
}
index.html
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Hello</title>
<meta charset="utf-8" />
</head>
<body>
<h1>Hello World</h1>
<p>
<span th:text="${message}"></span>!!!
</p>
</body>
</html>
[File (F)]-> [New (N)]-> [Spring Starter Project]
.
Hello
as the name and click theNext>
button.
[Template Engine] → [Thymeleaf]
and [Web] → [Spring Web]
and click the Finish
button.
com.example.demo
and select[New] → [Class]
.
HelloController
in the name and click theDone (F)
button.
templates
and select[New] → [Other]
.
[Web] → [HTML File]
and click the Next
button.
in
Filename (M) and click the
Done (F) `button.
Hello [boot]
and select [Run] → [5 Maven install]
.HelloController.java
and ʻindex.html` are [described above](# 3spring-boot-create project).
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.125 s
[INFO] Finished at: 2020-07-05T21:50:22+09:00
[INFO] ------------------------------------------------------------------------
console
.
Hello [boot]
and select [Run] → [9 Spring Boot Application]
.
-[Useful to remember !!!] Easy creation of constructor and getter / setter in Eclipse -[Useful to remember !!!] Easy creation of inherited class in Eclipse -[Useful to remember !!!] Change MySQL character code -[Even beginners can do it! ] How to write Javadoc -[Easy-to-understand explanation! ] How to use Java overload -[Easy-to-understand explanation! ] How to use Java encapsulation -[Easy-to-understand explanation! ] How to use Java inheritance [Override explanation] -[Easy-to-understand explanation! ] Type conversion of reference type in Java -[Easy-to-understand explanation! ] How to use Java polymorphism -[Easy-to-understand explanation! ] How to use ArrayList [Java] -[Practice! ] Introduction of JFrame (explanation up to screen creation) -[Practice! ] Java database linkage (Connector / J 8.0.20) -[Practice! ] Execution of SQL statement -All about Java programming
Recommended Posts