上一篇我们学习了服务的注册与发现,本篇博客是在上一篇的基础上学习服务的调用。上一博客主要创建了Eureka的服务端和一个Client,该Client包含了一个Controller用来提供对外服务供外部调用,可以作为生产者。 一、引入依赖 前面创建了EurekaClient的项目,在项目中引入了spr ...
分类:
编程语言 时间:
2019-07-08 00:30:15
阅读次数:
108
Hello World 1、创建一个maven工程;(jar) 2、导入spring boot相关的依赖 3、编写一个主程序;启动Spring Boot应用 4、编写相关的Controller、Service 5、运行主程序测试 6、简化部署 将这个应用打成jar包,直接使用java -jar的命令 ...
分类:
编程语言 时间:
2019-07-08 00:13:51
阅读次数:
114
model、dao、service、controller之间的关系,还有util和task的简介 model: 与数据库中的表一一对应,实现set和get的方法。 ...
分类:
Web程序 时间:
2019-07-07 21:30:59
阅读次数:
176
/** * 全局捕获异常 */ @ControllerAdvice(basePackages = "com.liangjian.controller")//扫包范围 public class GlobalExceptionHandler { @ExceptionHandler(RuntimeExce... ...
分类:
编程语言 时间:
2019-07-07 09:56:15
阅读次数:
116
参考:https://blog.csdn.net/a532672728/article/details/78057218 get方法 : 1. http://localhost:8080/0919/test1?name=xxx&pwd=yyy 方法一:String test String name, ...
分类:
编程语言 时间:
2019-07-07 09:49:46
阅读次数:
98
项目中经常会遇到跨域问题,解决方法: 在appsettings.json 文件中添加json项 在Startup文件中进行设置 在Controller类上进行跨域设置 [EnableCors("AllowAll")] ...
分类:
Web程序 时间:
2019-07-06 19:49:41
阅读次数:
165
@Controller public class ItemController { @Autowired private ItemService itemService; @RequestMapping("/item/{itemId}") //@ResponseBody public void ge... ...
分类:
编程语言 时间:
2019-07-06 13:06:27
阅读次数:
111
一、使用idea创建一个spring-boot项目,选择groovy语言 二、编写相应代码 1、创建实例类 2、创建service 3、创建controller 4、运行ExampleApplication.groovy 打开浏览器,访问:http://localhost:8080/ok 三、代码结 ...
分类:
编程语言 时间:
2019-07-05 00:39:40
阅读次数:
179
Openvswitch是一个virutal swtich, 支持Open Flow协议,当然也有一些硬件Switch也支持Open Flow协议,他们都可以被统一的Controller管理,从而实现物理机和虚拟机的网络联通。 Open Switch定义了一系列Flow Table,通过它来控制包的流 ...
分类:
其他好文 时间:
2019-07-04 17:35:45
阅读次数:
90