Tag:Interceptor

  • Teach you how to develop mybatis plug-in

    Time:2021-9-22

    Happy Lantern Festival, my friends. Remember to eat Lantern Festival In daily development, my friends have used mybatis plug-in more or less. Brother song guesses that the paging plug-in of mybatis is the most used! I wonder if my friends have ever thought of developing a mybatis plug-in one day? In fact, it’s not difficult […]

  • Method of adding interceptor in springboot

    Time:2021-9-17

    Create interceptor Create a class to implement the handleinterceptor interface (or inherit the abstract class that implements the interface), and implement the prehandle, posthandle and aftercompletion methods. public class MyInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { return true; } @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, […]

  • Configure the global exception interceptor in springboot and return the self-determined HTTP error code to the front end

    Time:2021-9-16

    Create interceptor class and annotate @ controlleradvice annotation @ControllerAdvice public class GlobalExceptionAdvice { //Handle unknown exception @ExceptionHandler(Exception.class) @ResponseBody @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) public UnifyResponse handleException(HttpServletRequest request, Exception e){ String method = request.getMethod(); String requestUrl = request.getRequestURI(); System.out.println(method); System.out.println(requestUrl); System.out.println(e); Unifyresponse unifyresponse = new unifyresponse (9999, “server exception”, requesturl + “” + method); return unifyResponse; } } public class […]

  • Java + springboot implements the interceptor to grab the interface address and response time and store them in the database

    Time:2021-9-7

    1. Create a new table in the database Because it needs to be stored in the database, I didn’t make this table very large according to your actual business, because it will be deleted in less than a few days. Table names and fields are as you like: Table name: biz_ monitor_ time Id int […]

  • Axios network interactive application – Vue

    Time:2021-9-3

    Author | jeskson Source: dada front end Tavern <template> <div id=”app”> <input type=”text” placeholder=”name” v-model=”user.name”> <input type=”text” placeholder=”age” v-model=”user.age”> <button type=”button” class=”btn” @click=”btn.clickcallback”> {{btn.text}} </button> <table class=”table”> <thead> <tr> <th>id</th> <th>name</th> < th > operation < / th > </tr> </thead> <tbody> <tr v-for=”item,index) in users” :kkey=”index”> <td scope=”row”>{{item.id}}</td> <td>{{item.name}}</td> <td> <a class=”btn” href=”#” role=”button” […]

  • Analysis of spring boot + mybatis interceptor failure

    Time:2021-9-2

    1、 Environmental informationSpringBoot:2.3.6.RELEASEMybatis-plus:3.3.12、 Encounter problemsToday, due to the functional needs of the business system, the interceptor of mybatis is used to set the user’s current locale (NLS) for the Oracle database session_ Language), if the interceptor code does not take effect, it is hereby recorded for future reference.3、 The code is as follows:1. Add the […]

  • Kafka: Producer (0.10.0.0)

    Time:2021-8-24

    Getting started with producer API Producer record description Asynchronous sending process 2.1 the user thread calls send to compress the record into the bufferpool 2.2 sending scheduling Producer design description Producer Configuration 1. Introduction to producer API: Kafkaproducer is a client API that sends records to Kafka cluster. This class is thread safe. In an […]

  • Spring code skills that you can’t put down

    Time:2021-8-24

    preface Recently, more and more readers recognize my article, which is still a very happy thing. Some readers wrote privately that I hope to share more articles on spring later, which can be used in practical work. I happen to have done some research on the spring source code. Combined with my practical work experience […]

  • How to use resttemplate with ribbon?

    Time:2021-8-24

    1、 Integrating ribbon with resttemplateSpring provides a simple and convenient template class for API calls, that is, resttemplate. Using resttemplateFirst, let’s take a look at the use of get requests: two interfaces are added to the housecontroller of FSH house service. One passes parameters through @ requestparam and returns an object information; The other passes […]

  • Vue Foundation (VIII): Vue front-end interaction

    Time:2021-8-6

    one   Vue front end interaction What are the methods of interface call? Native Ajax Ajax based on jquery Fetch Promise What are the URL address formats? Traditional URL URL in restful form 1.1 asynchronous The execution environment of JavaScript is “single thread” The so-called single thread means that there is only one thread in […]

  • [c#] use castle to implement AOP and Autofac to integrate castle

    Time:2021-8-6

    Castle was born in the Apache Avalon project in 2003 to create an IOC framework. Up to now, there are four components: ORM component: activerecord IOC component: Windsor Dynamic proxy component: dynamicproxy Web MVC component: Monorail This article focuses on dynamic agent componentsCastle.DynamicProxy Basic Usage Castle.DynamicProxyIt is realized by dynamically generating proxy classes through emit […]

  • Pulsar community weekly | 2021-01-18 ~ 2021-01-24

    Time:2021-8-3

    About Apache pulsar Apache pulsar is a top-level project of the Apache Software Foundation. It is a native distributed message flow platform for the next generation cloud. It integrates message, storage and lightweight functional computing. It adopts a separate architecture design of computing and storage, supports multi tenant, persistent storage, multi machine room cross regional […]