当前位置: 首页 > news >正文

化妆品网站建设原因数据分析师要学什么课程

化妆品网站建设原因,数据分析师要学什么课程,手机触屏网站幻灯片,wordpress 上传 阿里云问题 因为最近这个项目没有调用链监控系统的支持#xff0c;但是#xff0c;本地PostMan调试的时候又需要请求头才能正常调试。 思路 喊ChatGPT实现一下能够打印所有请求头的拦截器#xff0c;然后#xff0c;集成到已有代码即可。 解决 RequestHeaderInterceptor.jav…问题 因为最近这个项目没有调用链监控系统的支持但是本地PostMan调试的时候又需要请求头才能正常调试。 思路 喊ChatGPT实现一下能够打印所有请求头的拦截器然后集成到已有代码即可。 解决 RequestHeaderInterceptor.java package cn.xxxx.interceptor;import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; import org.springframework.web.servlet.HandlerInterceptor;import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Enumeration;/*** 打印接受到的所有请求头* author zhangyalin*/ Slf4j Component public class RequestHeaderInterceptor implements HandlerInterceptor {Overridepublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {// 获取所有请求头的名称EnumerationString headerNames request.getHeaderNames();while (headerNames.hasMoreElements()) {String headerName headerNames.nextElement();// 获取请求头的值并打印String headerValue request.getHeader(headerName);log.debug(headerName : headerValue);}return HandlerInterceptor.super.preHandle(request, response, handler);} } WebMvcConfiguration.java 在Springboot的配置类中集成上面的拦截器即可。 package cn.xxxx.config;import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;import javax.annotation.Resource;/*** 基础配置* author zhangyalin*/ RefreshScope ComponentScan({cn.xxxx, cn.xxx.sxa}) Configuration public class WebMvcConfiguration implements WebMvcConfigurer {Resourceprivate RequestHeaderInterceptor requestHeaderInterceptor;Value(${interceptors.requestHeaderInterceptor:false})private boolean requestHeaderInterceptorEnable;/*** 注入拦截器**/Overridepublic void addInterceptors(InterceptorRegistry registry) {if (requestHeaderInterceptorEnable){// 打印所有请求头registry.addInterceptor(requestHeaderInterceptor).order(Ordered.HIGHEST_PRECEDENCE).addPathPatterns(/**);}} } 配置中心 logging:level:cn.xxxx.interceptor: DEBUG interceptors:requestHeaderInterceptor: true总结 这就是简单使用HandlerInterceptor实现自己的请求头打印拦截器。我这里配置中心动态性还是不很完善。interceptors.requestHeaderInterceptor配置修改后得重启服务才能生效。
http://www.pierceye.com/news/577021/

相关文章:

  • 济宁网站建设 企业谷wordpress手机 不适应
  • 如何用php做网站合肥专业手机网站哪家好
  • 如何推广自己的网站和产品如何用dw做网站地图
  • 株洲有名的网站重庆市公路建设信息网官网
  • 网站安全证书出错怎么做dw网页制作素材网站
  • 收录查询 站长工具给网站做解答是干嘛的
  • 成都哪些公司可以做网站建网站现软件
  • 深圳wap网站建设传奇霸主页游
  • 做网站首先要干什么营销软文200字
  • 帝国cms做的网站私人定制女装店
  • 网站建设南沙wordpress video
  • 网站建设开票应该开哪个行业什么网站可以免费做视频的软件
  • 百度seo查询收录查询网站推广策划案seo教程
  • 如何免费建立网站中贤建设集团网站
  • 如何做转运网站黄聪 wordpress
  • 临海市住房与城乡建设规划局网站宁波网络推广培训
  • go 网站开发自己在线制作logo
  • 重庆市网站建设公司企业服务账号
  • 网站建设的市场情况网站系统里不能打印
  • 网站如何适应屏幕做网站时无法上传图片
  • 网站的橱窗怎么做嘉兴住房和城乡建设厅网站
  • 吉林省城乡建设官方网站163企业邮箱登录入口官网
  • 做网站参考文献某企业网站建设方案2000字
  • 网站托管哪家好织梦购物网站整站源码
  • 怎么做网站的优化排名wordpress的目录结构(一)
  • 个人可以做公益网站吗美食杰网站的建设目的
  • 宿迁公司企业网站建设《网站基础建设-首保》
  • 做全屏式网站尺寸是多大国外虚拟主机 两个网站
  • 黑龙江建设网站招聘广西住房和城乡建设厅培训中心官方网站
  • 做网站客户最关心的是什么制作网页原型的目的