Главная
Java
Spring
Spring Boot
Spring Boot. hello world
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@SpringBootApplication
public class DemoApplication {
@RequestMapping("/hello")
public String showHelloWorld(){
return "hello-world";
}
-------------------------------------------
pom.xml :
dependency
groupId org.springframework.boot groupId
artifactId spring-boot-starter-freemarker artifactId
dependency
--------------------------------------------------
\src\main\resources\templates\hello-world.ftl
----------------------------------------------------
mvn clean package