spring mvc Exception处理

 

Spring3.0中对异常的处理方法一共提供了两种:一种是使用HandlerExceptionResolver接口;一种是在Controller类内部使用@ExceptionHandler注解。使用第一种方式可以实现全局异常控制,并且Spring已经提供了一个默认的实现类SimpleMappingExceptionResolver;使用第二种方式可以在Controller内部实现更个性化点异常处理方式,灵活性更高。一般来说,项目中只需要采用第一种方式就可以了,每个人都自己定义异常的展现方式,太过个性了,不统一。

 

从目前的调查结果看,这两种方式不能共存,不知道未来的版本是否能将他们合二为一,这样才能灵活配置。

基于HandlerExceptionResolver接口的异常处理:

使用这种方式只需要实现resolveException方法,该方法返回一个ModelAndView对象,在方法内部对异常的类型进行判断,然后常见合适的ModelAndView对象,如果该方法返回了null,则Spring会继续寻找其他的实现了HandlerExceptionResolver接口的Bean。换句话说,Spring会搜索所有注册在其环境中的实现了HandlerExceptionResolver接口的Bean,逐个执行,直到返回了一个ModelAndView对象。

示例代码:

 

package cn.easier.exception;

import java.io.IOException;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;

import cn.easier.util.StringPrintWriter;

public class CustomExceptionHandler implements HandlerExceptionResolver {

	@Override
	public ModelAndView resolveException(HttpServletRequest request,
			HttpServletResponse response, Object handler, Exception exception) {
		
		System.out.println("CustomExceptionHandler..........................");
		
		Map<String,Object> map = new HashMap<String,Object>();  
		//我们还需要一个辅助的类StringPrintWriter,因为ex.printStackTrace参数只有个PrintWriter类型的,java自带的StringWriter 
		//不可用,所以我们需要自己实现一个装饰器的StringPrintWriter。
        StringPrintWriter strintPrintWriter = new StringPrintWriter();  
        exception.printStackTrace(strintPrintWriter);  
        
        map.put("ex", strintPrintWriter.toString());//将错误信息传递给view  
 
      
		if(exception instanceof IOException){  
            return new ModelAndView("IOError",map);  		//只能是地址,而且是跟spring-servlet配置中的prefix有关系
        }else if(exception instanceof SQLException){  
            return new ModelAndView("SQLError",map);  
        }else if(exception instanceof RuntimeException){
        	
        	
        	
        	 return new ModelAndView("error",map); //只能在request作用域中
        }
		
        return null;  
	}

}
 

 

spring 声明:

 

<bean id="customExceptionHandler" class="cn.easier.exception.CustomExceptionHandler"/>
 

 

这个类必须声明到Spring中去,让Spring管理它,你可以使用@Component标签,也可以使用<bean/>节点。为了简单的进行异常处理,Spring提供了SimpleMappingExceptionResolver类,该类实现了HandlerExceptionResolver接口,需要使用时只需要使用<bean/>节点进行声明即可,示例如下:

Xml代码 
  1. <bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">  
  2.     <!-- 定义默认的异常处理页面,当该异常类型的注册时使用 -->  
  3.     <property name="defaultErrorView" value="error"></property>  
  4.    <!--定义异常处理页面用来获取异常信息的变量名,默认名value为exception-->
  5.     <property name="exceptionAttribute" value="ex"></property>  
  6.     <!-- 定义需要特殊处理的异常,用类名或完全路径名作为key,异常也页名作为值 -->  
  7.     <property name="exceptionMappings">  
  8.         <props>  
  9.             <prop key="IOException">error</prop>  
  10.             <prop key="java.sql.SQLException">error</prop>  
  11.         </props>  
  12.     </property>  
  13. </bean>  

基于@ExceptionHandler的异常处理:

该方法需要定义在Controller内部,然后创建一个方法并用@ExceptionHandler注解来修饰用来处理异常,这个方法基本和@RequestMapping修饰的方法差不多,只是可以多一个类型为Exception的参数,@ExceptionHandler中可以添加一个或多个异常的类型,如果为空的话则认为可以触发所有的异常类型错误。

示例代码:

Java代码 
  1. /** 
  2.  * 基于@ExceptionHandler异常处理 
  3.  * @author ZYWANG 2011-4-2 
  4.  */  
  5. @Controller  
  6. public class ExceptionHandlerController {  
  7.       
  8.     @ExceptionHandler(value={IOException.class,SQLException.class})  
  9.     public String exp(Exception ex,HttpServletRequest request) {  
  10.         request.setAttribute("ex", ex);  
  11.         return "/error.jsp";  
  12.     }  
  13.   
  14. }  

页面使用erro.jsp

 

 

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.lang.Exception" %>
<%@ page import="java.io.PrintWriter" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%-- 
//因为SimpleMappingExceptionResolver中的ex 是一个java.lang.Exception类型
<%Exception ex=(Exception)request.getAttribute("ex");%> --%>
<H2>Exception:</H2>
<%-- <%ex.printStackTrace(new PrintWriter(out));%> --%>
<!--<c:out value="${exception}"></c:out>-->
<!--map.put("ex", strintPrintWriter.toString());//将错误信息传递给view  -->
<%=request.getAttribute("ex")%>
</body>
</html>
 

 

引用地址:http://zywang.iteye.com/blog/983801

 

芒果YOLOv8改进165:损失函数angleLoss:即插即用 | 独家首发原创新颖|公开数据集DOTA高效无损涨点0.5% | 旋转检测 YOLOv8改进:旋转检测Loss损失函数angleLoss:即插即用 | 独家首发原创新颖|公开数据集DOTA高效无损涨点0.5% 阅读详情

相关推荐

Win10更新后黑屏只剩鼠标?火绒误杀explorer.exe的5种自救方案(附详细步骤)

本文详细介绍了Win10更新后出现黑屏只剩鼠标的5种专业修复方案,重点解决火绒误杀explorer.exe的问题。从基础的任务管理器操作到安全模式下的系统修复,再到注册表编辑和系统还原,提供了全面的解决方案,帮助用户快速恢复系统正常运行。

weixin_29306571的博客 648

springMVC三种异常处理方式

Spring MVC处理异常有3种方式:  (1)使用Spring MVC提供的简单异常处理器SimpleMappingExceptionResolver;  (2)实现Spring的异常处理接口HandlerExceptionResolver 自定义自己的异常处理器; (3)使用@ExceptionHandler注解实现异常处理。 SimpleMappingExceptionReso

东语的专栏 1万+

visionpro官方示例分析(一) 模板匹配工具 缺陷检测工具

使用CogPMAlignTool工具,该工具是模板匹配工具,见名知意,所谓模板匹配工具就是说先使用该工具对一张图像建立模板,然后用这个模板在其他图像上进行匹配,匹配上了就说明找到了,匹配不上就说明没有找到。

sc_1313的博客 1926

使用Spring MVC统一异常处理实战

[size=x-large][b]1 描述[/b][/size] 在J2EE项目的开发中,不管是对底层的数据库操作过程,还是业务层的处理过程,还是控制层的处理过程,都不可避免会遇到各种可预知的、不可预知的异常需要处理。每个过程都单独处理异常,系统的代码耦合度高,工作量大且不好统一,维护的工作量也很大。 那么,能不能将所有类型的异常处理从各处理过程解耦出来,这样既保证了相关处理过程的功能较单一,...

常想一二 2173

【自动驾驶控制算法】 第一讲 绪论

声明【自动驾驶控制算法】系列是博主对所分享教学内容的学习笔记,并且该系列每篇博客都会将博主听课后总结的纸质版笔记附于文末,供大家参考。是一位研究汽车领域,无人驾驶方向及其相关方向的大佬,也算是博主在无人驾驶方向的启蒙老师。所以研究相关领域的朋友推荐去听一听他的视频讲解。...

iamtbon_1的博客 1797

Docker+vLLM内网离线部署Qwen3 流程

本文介绍了在CentOS 7系统下进行VLLM容器化部署Qwen3-32B大模型的内网离线方案。首先需准备Nvidia显卡驱动、CUDA 12.4和Docker环境。通过联网机器拉取vllm/vllm-openai镜像并导入内网服务器,同时从魔塔社区下载模型文件。部署时使用docker run命令启动容器,配置了GPU资源、内存共享、端口映射等参数,特别指定了模型路径、并行计算、内存利用率等关键参数。该方案实现了大模型在内网环境的安全高效部署,适用于需要离线运行的AI推理场景。

qq_42881308的博客 1043

SpringMVC 学习笔记(十) 异常处理HandlerExceptionResolver

Spring MVC 通过 HandlerExceptionResolver 处理程序的异常,包括 Handler 映射、数据绑定以及目标方法执行时发生的异常。 ExceptionHandlerExceptionResolver 主要处理 Handler 中用 @ExceptionHandler 注解定义的方法。 在异常及异常父类中找到 @ResponseStatus 注解,然后使用这个注解的属性进行处理。 对一些特殊的异常进行处理,比如NoSuchRequestHandlingMethodExcepti

胡小海丶 1万+

5G移动性管理实战:手把手教你配置NR小区重选参数(附避坑指南)

本文深入解析5G网络移动性管理中的小区重选参数配置实战。通过拆解小区选择与重选的核心机制,结合真实案例,手把手指导如何配置NR小区重选参数,并分享常见避坑指南,帮助工程师优化网络性能,提升用户移动体验。

weixin_29229261的博客 200

SpringMVC之异常处理

SpringMVC之异常处理 配置文件中添加异常对应的Resolver Bean <!--异常处理--> <bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"> <!-- 定义默认的异常处理页面,当该异常类型的注册时使用 --> <pro

g1418377085的博客 293

FPGA编译加速实战:6大可落地的Vivado优化策略

FPGA编译本质上是NP-hard约束满足问题求解,而非传统软件编译;Vivado作为时序驱动的硬件实现工具链,其耗时瓶颈集中在Implementation阶段的布局布线(PnR)与逻辑优化。理解这一原理,才能跳出‘加线程’‘升版本’等表面优化,转向精准时序约束、增量编译、物理锚点控制、IP配置精简等工程级干预。这些技术手段直接作用于Vivado的Tcl执行流与底层求解空间,显著压缩搜索范围、减少无效迭代——尤其适用于Zynq/UltraScale等中大型项目(LUT > 80K、多时钟域、DDR/PCIe

weixin_34226182的博客 416

半导体器件仿真:MOSFET仿真_(3).MOSFET仿真软件介绍

在半导体器件仿真领域,MOSFET(金属氧化物半导体场效应晶体管)的仿真是一项非常重要的任务。MOSFET是现代电子设备中最基本的元件之一,广泛应用于集成电路设计、功率电子、射频电路等众多领域。为了准确预测和分析MOSFET在不同条件下的性能,仿真软件成为了不可或缺的工具。本节将介绍几种常用的MOSFET仿真软件,包括它们的基本功能、主要特点以及应用场景。

2401_87715305的博客 1229

springmvc三种全局异常处理

其实自己一直有想把自己的项目弄的越简洁越好,不用把项目中每个方法看起来比较臃肿,所以自己没事就去论坛,博客看别人怎么整合 今天特意写一些自己上个项目中用到的异常全局拦截处理 springmvc有三种方式 1.使用springmvc提供简单异常处理器simpleMappingException 2.实现spring的异常处理接口handleerExceptionResolver自定义处理异常

一个菜鸟的学习之路 7710

开源项目-智能算法中台管理系统

智能算法中台管理系统,系统主要有样本中心,算法中心,模型中心等模块

u010479989的博客 3004

Spring MVC全局处理Exception

/** * Created by Administrator on 2017/7/18. */ @ControllerAdvice public class ExceptionHandle { @ExceptionHandler(value = Exception.class) @ResponseBody public Result handle(Exception e)

不会写博客 742

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

推荐项目:Spring MVC ReST Exception Handler - 精确控制你的API错误处理

推荐项目:Spring MVC ReST Exception Handler - 精确控制你的API错误处理 项目介绍 spring-mvc-rest-exhandler 是一个基于 Spring MVC 的 ReST 异常处理器示例项目。这个项目是为了解决在构建 ReSTful API 时,如何优雅地处理和返回异常信息而设计的。它通过提供一种最佳实践,帮助开发者确保他们的 API 提供一致且易于...

gitblog_00067的博客 460

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

java统一异常处理

常见异常 常见异常如下图 Error是系统级别的错误,程序代码无法处理的,比如OutOfMemoryError、ThreadDeath等。这些错误发生时,JVM一般会选择线程终止退出,它表示程序在运行期间出现了十分严重、不可恢复的错误,应用程序只能中止运行。程序中显示调用System.exit(1);也会退出虚拟机。 Exception分为两种,运行时异常和检查异常(CheckedExc...

越自律越自由 1万+

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

SpringBoot多异常处理@ControllerAdvice的坑

项目有多个子模块 模块1:security共通模块 模块2:exception共通模块 模块1: @Slf4j @Order(1) @ResponseBody @ControllerAdvice public class RSecurityDispose { /** * 额外处理一下 AccessDeniedException 无权限异常 * @param request request * @param e e * @return R<String&

temie的博客 623

异常处理@ExceptionHandler遇到的问题

使用@ExceptionHandler处理异常发现了两个问题 1.首先发现配置了@ExceptionHandler 处理业务异常或者原生的Exception异常时候 发现没有效果 代码如下  @Controller public class BaseExceptionHandler { private static final Logger LOGGER = LoggerFa...

Flyer的后花园 4万+

spring boot 404 自定义拦截问题

配置出现异常 直接抛出异常 spring.mvc.throw-exception-if-no-handler-found=true /** * 异常监听类 * Created by liqun on 2018/4/19. */ @ControllerAdvice public class ExceptionHandle { private final static L...

青尘醉博客 2125

springmvc的异常处理

1.自定义一个包和一个类:继承Exception类: package com.itheima.springmvc.exception; public class MessageException extends Exception{ /** * 只是一个类的版本控制ID,防止版本冲突 */ private static final long serialVersionUID...

qq_735311015的博客 153

阶段3 3.SpringMVC·_06.异常处理及拦截器_3 SpringMVC异常处理之异常处理代码编写

分三步 新建exception的包。然后添加SysException类 一般写异常都继承。Exception 定义Messgae属性,生成get和set 生成带参数的构造方法 选中异常的代码 Ctrl+Alt+T 选择try catch就可以了 抛出自定义的异常类 异常处理器类 需要实现特定的接口:HandlerExcep...

weixin_30566063的博客 87

spring 源码深度解析_Spring源码解析 -- SpringMvc原理

Spring源码解析 -- 读取bean元数据spring源码解析 -- 构造beanspring源码解析 -- 注入属性spring源码解析 -- Spring ContextSpring源码解析 -- AOP原理(1)Spring源码解析 -- AOP原理(2)Spring源码解析 -- SpringMvc原理源码分析基于spring 4.3.x本文通过阅读Spring MVC的源码,解析Sp...

weixin_39857899的博客 129

springboot 对404的处理

默认情况下发送一个不存在的请求、该请求会转发到/${context-path}/error 并且不会被ControllerAdvice拦截 2018-03-06 10:30:20.969 WARN [http-nio-9090-exec-5] - No mapping found for HTTP request with URI [/oa/appmanager/queryList] in ...

天下无双 3701

spring controller可以获取的类型

Spring Controller内置类型 参考文档 spring可以获取 request的参数, 请求头等等, 详见参考文档 绑定结果集BindingResult 错误Errors(实现类) Exception(以及子类)

zhao2406的博客 260

tomcat服务重启后出现好多Exception,原来竟然是...

开发组里一小伙排查问题时,奇怪地发现tomcat服务重启后catalina.out文件中出现了好多异常。然后发wiki记录了下来。 得知此事后,我用他提供的grep命令查了一下catalina.out文件,的确存在很多包含“Exception”的日志。 再仔细看,发现都是INFO日志。再仔细看,这些语句都是 mapped ***url onto ****Controller.***method...

gzyes 126

Spring Web MVC核心组件解析

📕我是廖志伟,一名Java开发工程师、《Java项目实战——深入理解大型互联网企业通用技术》、(架构篇)、作者、清华大学出版社签约作家、Java领域优质创作者、优快云博客专家、阿里云专家博主、51CTO专家博主、产品软文专业写手、技术文章评审老师、技术类问卷调查设计师、幕后大佬社区创始人、开源项目贡献者。

MoneyHacksPro的博客 843
上一篇: 用左脑还是右脑思维(非常有趣的测试)?
下一篇: spring的HibernateDaoSupport以及HibernateTemplate和jdbcTemplate的选择问题
tempdowncomputer
博客等级 码龄16年 2粉丝 405原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值