spring-web
整理spring-web里支持的文件以及对应的Content-Type
最近在弄文件上传、下载、在线预览时经常需要设置请求标头或者响应标头的Content-Type 属性。所以研究了一下spring支持哪些Content-Type,通过研究MediaTypeFactory.getMediaType的源码,可以得知spring是将支持的Content-Type 维护在/o... ......
spring-web中的annotation注解之十:@ModelAttribute
spring-web中的annotation注解之十:@ModelAttribute 1、@ModelAttribute注解在方法上:*该方法在Controller每个方法执行前会被调用,没有返回值的 @ModelAttribute 方法使用 model.addAttribute(String ke ......
spring-web中的annotation注解之五:@ExceptionHandler
spring-web中的annotation注解之五:@ExceptionHandler 解释:异常处理注解,该注解作用对象为方法,并且在运行时有效,可以指定异常类型也可以不指定。 方法的参数:由该注解注释的方法可以具有灵活的输入参数,异常参数e、ServletRequest/HttpServlet ......