1. 程式人生 > 資料庫 >mysql udf提權

mysql udf提權

1.springboot異常處理
BasicErrorController:處理預設/error請求
DefaultErrorViewResolver:響應頁面;去哪個頁面是由DefaultErrorViewResolver解析得到的

2.配置嵌入式Servlet容器
SpringBoot預設使用Tomcat作為嵌入式的Servlet容器;
在這裡插入圖片描述

3.註冊Web三大元件
由於SpringBoot預設是以jar包的方式啟動嵌入式的Servlet容器來啟動SpringBoot的web應用,沒有web.xml檔案。
註冊三大元件用以下方式:
(1)ServletRegistrationBean 註冊Servlet元件

(2)FilterRegistrationBean 註冊Filter元件
(3)ServletListenerRegistrationBean 註冊監聽器元件

4.Docker簡介

Docker是一個開源的應用容器引擎;是一個輕量級容器技術;
Docker支援將軟體編譯成一個映象;然後在映象中各種軟體做好配置,將映象釋出出去,其他使用者可以直接使用這個映象;
執行中的這個映象稱為容器,容器啟動是非常快速的。

5.Docker的核心概念
docker主機(Host):安裝了Docker程式的機器(Docker直接安裝在作業系統之上);
docker客戶端(Client):連線docker主機進行操作;

docker倉庫(Registry):用來儲存各種打包好的軟體映象;
docker映象(Images):軟體打包好的映象;放在docker倉庫中
docker容器(Container):映象啟動後的例項稱為一個容器;容器是獨立執行的一個或一組應用
6. springboot如何開啟自動配置

main方法所在類的@SpringBootApplication註解

SpringBootApplication
public class SpringbootQuickApplication {
public static void main(String[] args) {
SpringApplication.run(SpringbootQuickApplication.class,args);

}
}

8.springboot如何處理異常的
自定義錯誤頁面
@ExceptionHandle 註解處理異常
@[email protected] 註解處理異常
配置 SimpleMappingExceptionResolver 處理異常
自定義 HandlerExceptionResolver 類處理異常

9.在springboot中,如何使用攔截器?
實現攔截器
public class InterceptorDemo extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {
StringBuffer requestURL = httpServletRequest.getRequestURL();
System.out.println(“前置攔截器1 preHandle: 請求的uri為:”+requestURL.toString());
return true;
}
@Override
public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {
System.out.println("攔截器1 postHandle: ");
}

@Override
public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, 		Object o, Exception e) throws Exception {
    System.out.println("攔截器1 afterCompletion: ");
}

}
註冊攔截器
@Configuration
public class InterceptorConfig implements WebMvcConfigurer{

//註冊自定義攔截器
@Override
public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(new InterceptorDemo2()).addPathPatterns("/**");
    registry.addInterceptor(new InterceptorDemo()).addPathPatterns("/**");
}

}