
spring
fadedsun
从质疑自己,到坚定梦想.
展开
-
SpringBoot使用SpringSecurity, web.ignore失效
@Configuration@EnableGlobalMethodSecurity(prePostEnabled=true)public class CustomSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.sessionManagement().se原创 2020-10-20 14:32:16 · 2698 阅读 · 1 评论 -
Springboot使用hbase
依赖gradle引入依赖 // https://mvnrepository.com/artifact/org.apache.hbase/hbase-client compile group: 'org.apache.hbase', name: 'hbase-client', version: '2.3.0' // https://mvnrepository.com/artifact/org.apache.hbase/hbase-server compile group:原创 2020-08-04 10:36:57 · 375 阅读 · 0 评论 -
Springboot 异常处理,实现运行时刷新返回提示语
以下所有代码均是伪代码, 并不保证运行,如果需要完整代码私聊我异常处理由来前端给用户显示提示信息后端记录异常日志,查错,并保证程序正常运行前端提示信息前端代码前端根据后端给的errorCode判断,然后前端给出提示信息// 发起http请求result = this.axios.get("xxxx");// 如果成功直接返回结果if (result.status == 200) { return result;}// 不成功根据errorCode 弹出提示信息erro原创 2020-07-26 18:27:46 · 1405 阅读 · 0 评论 -
SpringBoot最简单两步全局结果处理
新建全局处理类@RestControllerAdvice@Slf4jpublic class GlobalResultHandler implements ResponseBodyAdvice<Object> { @Override public boolean supports(MethodParameter methodParameter, Class<? extends HttpMessageConverter<?>> converterTy原创 2020-07-22 18:02:19 · 536 阅读 · 0 评论 -
Centos7.3 搭建springboot自动部署环境
1.首先购买一台服务器2.安装Centos7.3系统3.更新yumyum update4.安装指定版本javayum -y install java-1.8.0-openjdk.x86_645.看文档Jenkinshttps://jenkins.io/zh/doc/pipeline/tour/getting-started/6.下载Jenkinshttp://mirrors...原创 2020-03-04 21:06:34 · 990 阅读 · 0 评论 -
springboot接受不到axios的post请求参数
在参数前面加@RequestBody注解,注意是Request,idea会自动补全到@ResponseBody,两者是不一样的 @PostMapping("/app_data/external_arousal_report") public ExternalArousalResponse test(@RequestBody ExternalArousalRequest exter...原创 2020-01-21 13:46:13 · 2582 阅读 · 0 评论