neo4j spring 集成案例
- 作者: 黑歌作者
- 来源: 51数据库
- 2020-09-27
建议你这样试试看:
1. 在 Eclipse 中新一个 maven 工程。
2. 修改 pom.xml 文件添加如下内容:
3.
????????org.springframework.boot
????????spring-boot-starter-parent
????????1.5.9.RELEASE
????
????
????????
????????????org.springframework.boot
????????????spring-boot-starter-web
????????
????????
????????org.springframework.boot
???????? spring-boot-starter-actuator
????????
????????
????????org.springframework.boot
???????? spring-boot-starter-test
????????test
????????
????
????
????????1.8
????
jdk-1.8
true
1.8
1.8
1.8
1.8
????????
????????????
????????????????org.springframework.boot
????????????????spring-boot-maven-plugin
????????????
????????
???? 4. 添加 Application 类:
import?org.springframework.boot.SpringApplication;
import?org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public?class?Application?{
public?static?void?main(String[]?args)?{
SpringApplication.run(Application.class,?args);
}
}5. 添加 HelloController 类:
import?org.springframework.web.bind.annotation.RequestMapping;
import?org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/hello")
public?class?HelloController?{
@RequestMapping("/welcome")
public?String?welcome()?{
return?"Hello?World!";
}
}然后运行。

搜一下:一个最简单的 spring boot restful 例子。
1. 在 Eclipse 中新一个 maven 工程。
2. 修改 pom.xml 文件添加如下内容:
3.
????????
????????spring-boot-starter-parent
????????
????
????
????????
????????????
????????????spring-boot-starter-web
????????
????????
????????
???????? spring-boot-starter-actuator
????????
????????
????????
???????? spring-boot-starter-test
????????
????????
????
????
????????
????
true
????????
????????????
????????????????
????????????????spring-boot-maven-plugin
????????????
????????
????
import?org.springframework.boot.SpringApplication;
import?org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public?class?Application?{
public?static?void?main(String[]?args)?{
SpringApplication.run(Application.class,?args);
}
}5. 添加 HelloController 类:
import?org.springframework.web.bind.annotation.RequestMapping;
import?org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/hello")
public?class?HelloController?{
@RequestMapping("/welcome")
public?String?welcome()?{
return?"Hello?World!";
}
}然后运行。

搜一下:一个最简单的 spring boot restful 例子。
推荐阅读
