随笔分类 - Java框架
摘要:1.概念 Feign是Spring Cloud Netflix组件中的一个轻量级RESTful的HTTP服务客户端,实现了负载均衡和Rest调用的开源框架 封装了Ribbon和RestTemplate,实现了WebService的面向接口编程,进一步降低了项目的耦合度。 Feign内置了Ribbon
阅读全文
摘要:## 1.概念 Consul是HashiCorp公司推出的开源工具,用于实现分布式系统的服务发现与配置。与其它分布式服务注册与发现的方案, Consul的方案更“一站式”,内置了服务注册与发现框架、分布一致性协议实现、 健康检查、Key/Value 存储、多数据中心方案, 不再需要依赖其它工具(比如
阅读全文
摘要:1.概念 Ribbon是一个基于HTTP和TCP的客服端负载均衡工具,它是基于Netflix Ribbon实现的。 它不像Spring Cloud服务注册中心、配置中心、API 网关那样独立部署,但是它几乎存在于每个Spring Cloud微服务中。 包括Feign提供的声明式服务调用也是基于该Ri
阅读全文
摘要:1.注册中心 服务注册中心是服务实现服务化管理的核心组件,类似于目录服务的作用。 主要用来存储服务信息,例如提供者url、路由信息等。 服务注册中心是的微服务架构中最基础的设施之一。 在微服务架构流行之前。注册中心就已经开始出现在分布式架构的系统中 Dubbo 是一个在国内比较流行的分布式框架,被大
阅读全文
摘要:1. 一对一 stu拥有一个stu_card 1.1 student实体类 将外键代表的实体放在属性 public class Student { private Integer sid; private String sname; private StuCard stuCard; private
阅读全文
摘要:<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <m
阅读全文
摘要:1.结构 配置的属性顺序不能错 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/my
阅读全文
摘要:1.pom.xml <dependency> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-core</artifactId> <version>1.3.5</version> </dependency>
阅读全文
摘要:1.表中主键名称和实体类中不对应,导致结果为空 添加resultMap映射关系 <resultMap id="articleMap" type="wenxuan.ltd.LwxWeb.entity.Article"> <id column="article_id" property="article
阅读全文
摘要:
阅读全文
摘要:需要在web.xml里将拦截器删除 将下面注释掉 <!--post乱码过滤器--> <!-- 配置springMVC编码过滤器 --> <filter> <filter-name>CharacterEncodingFilter</filter-name> <filter-class>org.spri
阅读全文
摘要:1.No converter found for return value of type: class java.util.ArrayList springmvc 默认是没有对象转换成json的转换器的 手动添加jackson依赖 <!-- jackson--> <dependency> <gro
阅读全文
摘要:1.get请求在url中通过?指定参数 直接将其写在参数上即可获得 public String addUser1(String username,String password) { System.out.println("username is:"+username); System.out.pr
阅读全文
摘要:1. 依赖 <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId> <version>5.1.10</version> </dependency> 2.service层 只有紧
阅读全文
摘要:1.javabean对象 <div> <div th:text="${user.getName()}"></div> </div> 2.List集合 <div th:each="item:${articles}"> <div th:text="${item.getTitle()}"></div> <
阅读全文
摘要:1.CSRF (Cross site request forgery) 跨站请求伪造,也被称为"OneClick Attack"或者Session Riding 通过伪造用户请求访问受信任站点的非法请求访问。 跨域:只要网络协议,ip 地址,端口中任何一个不相同就是跨域请求。 客户端与服务进行交互时
阅读全文
摘要:1. 引入依赖 <dependency> <groupId>org.thymeleaf.extras</groupId> <artifactId>thymeleaf-extras-springsecurity5</artifactId> </dependency> <dependency> <gro
阅读全文
摘要:1.引入依赖 <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.18</version> </dependency> <dependency> <group
阅读全文
摘要:1.@Secured 角色判断 1.1 开启注解 App启动类中加入注解 @EnableGlobalMethodSecurity(securedEnabled = true, prePostEnabled = true) 1.2 controller层下 @PostMapping("/toIndex
阅读全文

浙公网安备 33010602011771号